Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: toggle between all / only the given commits in --stdin mode #1355

Open
calestyo opened this issue Oct 25, 2024 · 7 comments

Comments

@calestyo
Copy link

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.

@koutcher
Copy link
Collaborator

koutcher commented Nov 7, 2024

Why would you need a script when you can do directly tig -L100,200:someFile ? You can then use ^ to toggle the rev filter.

@calestyo
Copy link
Author

calestyo commented Nov 7, 2024

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

@calestyo
Copy link
Author

calestyo commented Nov 7, 2024

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?

@koutcher
Copy link
Collaborator

koutcher commented Nov 7, 2024

Would be nice if the same commit could stay selected in the main view in that direction.

This is implemented in master.

@calestyo
Copy link
Author

calestyo commented Nov 8, 2024

I assume you mean 914c617 which is however "only" the later comment, right? (thanks btw)

Or would there be also already any colour highlighting?

@koutcher
Copy link
Collaborator

koutcher commented Dec 7, 2024

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.

@calestyo
Copy link
Author

calestyo commented Dec 7, 2024

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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants