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

Implement counterpart for - mapping in :Git log #2328

Closed
jclsn opened this issue Aug 14, 2024 · 13 comments
Closed

Implement counterpart for - mapping in :Git log #2328

jclsn opened this issue Aug 14, 2024 · 13 comments

Comments

@jclsn
Copy link

jclsn commented Aug 14, 2024

I have found that you can navigate down the commit history by pressing -. This mapping is undocumented in seems and there also is not counterpart +. Would it be possible to create one?

I have looked at the NavigateUp and DirRev functions, but it is not obvious to me how to achieve that.

@jclsn jclsn changed the title Implement counterpart for '-' mapping in :Git log Implement counterpart for - mapping in :Git log Aug 14, 2024
@tpope
Copy link
Owner

tpope commented Aug 14, 2024

No, that's not how Git works. Commits know about their parents but not their children. You can find children by hunting through the history of a branch, but which branch to hunt through is subjective. For example, the children that exist on main and the children that exist on dev might be different.

@tpope tpope closed this as completed Aug 14, 2024
@jclsn
Copy link
Author

jclsn commented Aug 14, 2024

I see. Would just have a nice way to jump back and forward through my merge request without having to open the browser. Works with :Gclog and the quickfix list, but for the kernel this is not usable.

@jclsn
Copy link
Author

jclsn commented Aug 14, 2024

Ah :Gclog -n 100 works like a charm

@tpope
Copy link
Owner

tpope commented Aug 14, 2024

Alternatively you can use :Gclog ^! to stop at the currently edited commit rather than after 100 commits.

@jclsn
Copy link
Author

jclsn commented Aug 14, 2024

How does that work? I don't understand what is meant by "currently edited commit". For me it just shows nothing

@tpope
Copy link
Owner

tpope commented Aug 14, 2024

Where are you using the - map?

@jclsn
Copy link
Author

jclsn commented Aug 14, 2024

I have my command Glog :Git log --oneline --decorate --graph -500 command and I am using it in there

@tpope
Copy link
Owner

tpope commented Aug 14, 2024

A command doesn't answer the question. What buffer are you using the - map in? The first result?

@jclsn
Copy link
Author

jclsn commented Aug 15, 2024

In the buffer of the diff, but no matter in which buffer I execute :Gclog ^! in, it just returns me an empty buffer

@tpope
Copy link
Owner

tpope commented Aug 15, 2024

In the buffer of the diff,

The first buffer that opens is the top most commit. It has no children. So it will not list anything.

but no matter in which buffer I execute :Gclog ^! in, it just returns me an empty buffer

Are you just trying it in random files? Those don't have child commits either.

@jclsn
Copy link
Author

jclsn commented Aug 16, 2024

The first buffer that opens is the top most commit. It has no children. So it will not list anything.

I did not try in the first commit, but in one further down.

Are you just trying it in random files? Those don't have child commits either.

I have been trying in many commits and files now. The list is alway empty

@tpope
Copy link
Owner

tpope commented Aug 19, 2024

I guess it needs a starting point too. Try :Gclog @ ^! to use the currently checked out branch.

@jclsn
Copy link
Author

jclsn commented Aug 21, 2024 via email

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