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

Enable jumping back in main view #1138

Merged
merged 2 commits into from
Oct 4, 2021
Merged

Enable jumping back in main view #1138

merged 2 commits into from
Oct 4, 2021

Conversation

kempniu
Copy link
Contributor

@kempniu kempniu commented Aug 12, 2021

Hi there,

First, thank you for all the work on this awesome tool.

The one feature that I have been missing is the ability to go back to the previously selected commit after jumping to its parent. I find that to be really useful for git repositories which are "heavily non-linear" (like the Linux kernel tree).

I see this idea has already been suggested in #628 and also in #506 (which implemented #388), so I took a stab at implementing it.

This PR looks almost too simple to be right, but it seems to work well for me :-) I would be happy to work on it further if the approach I chose is not the preferred one.

Hope this helps!

Allow going back to the previously selected commit after jumping to its
parent.

Fixes #628
@krobelus
Copy link
Contributor

Wow I never thought of using :parent in main view - LGTM

@koutcher
Copy link
Collaborator

Thanks, this makes the navigation in a messy git history really much easier.

@koutcher koutcher merged commit 2e31516 into jonas:master Oct 4, 2021
@typebrook
Copy link
Contributor

Works like a charm! Thank you @kempniu

koutcher added a commit to koutcher/tig that referenced this pull request Jan 4, 2022
With jonas#1138, using `:parent` after reaching an initial commit will keep
pushing the same state in the main view history, and `:back` must then
be used several times before it starts moving. Use lineno as data to
prevent pushing the same history state.

This a complement to 2e31516.
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

Successfully merging this pull request may close these issues.

4 participants