feature request: toggle between all / only the given commits in `--stdin` mode
Opened this issue · 7 comments
Hey.
I have a script, which does about like that:
git log --format=%H --no-patch -L "$@" | tig --stdin --no-walk
so I can call myscript 100,200:someFile
and tig
will show me only the commits which touched lines 100-200 as of the current HEAD
, which is quite nice.
But often it would then be handy to actually see the other commits, too, like in the main view… e.g. maybe having some key where one can toggle between showing only the commits given via stdin, and also all others.
If all are shown, it would be nice if there was some colour distinction (especially in the main view), and maybe two keys, which allow me to jump to the next/previous of the selected ones, amongst all.
Thanks,
Chris.
Why would you need a script when you can do directly tig -L100,200:someFile
? You can then use ^
to toggle the rev filter.
Neat.
But it seems I can't give it --follow
or does it do that automatically?
As for ^
... I kinda missed that this does actually already part of what I've asked for above. But it’s (for that particular purpose) IMO still rather useless if there's not at least some colour indication in the main view that shows which commits would be selected by the ref filter... and ideally (for large histories) some keys to cycle forwards/backwards to the ones that would be filtered
Oh and more over:
When I do the toggle with ^
the previously selected commit is no longer selected (when going form the filtered to the non-filtered list).
Would be nice if the same commit could stay selected in the main view in that direction.
Of course, hat doesn't make sense when going from the unfiltered to the filtered list...maybe in that case it should select the next earlier commit that is shown? Or the next following?
Would be nice if the same commit could stay selected in the main view in that direction.
This is implemented in master.
I assume you mean 914c617 which is however "only" the later comment, right? (thanks btw)
Or would there be also already any colour highlighting?
You assume correctly, Tig doesn't have highlighting. If you need to highlight some commits, you can however use the git notes
support as suggested in #915.
Hmm, not sure whether this is really the same than having colour highlighting. I mean it would show it as text, which would make it again much harder to spot such lines.
And it seems a bit brittle with respect to interfering with "actual" notes added to such commits.
But thanks anyway :-)