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

older/newer commit for blame_line #198

Open
CallumHoward opened this issue May 25, 2021 · 4 comments
Open

older/newer commit for blame_line #198

CallumHoward opened this issue May 25, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@CallumHoward
Copy link

CallumHoward commented May 25, 2021

Is your feature request related to a problem? Please describe.
The git-messenger.vim plugin has functionality to show previous commits for the blame_line, see here. When the commit message window is focussed, o and O can be used to move between older and newer commits. I miss this functionality.

Describe the solution you'd like
Functions that can be mapped that allow moving between older and newer commits for the blame_line.

Describe alternatives you've considered
Current workaround is to open in GitHub blame and click the icon which goes to previous commit for a line. Another alternative is to also install git-messenger.vim.

Additional context
git-messenger.vim gif
git-messenger.vim gif

@lewis6991
Copy link
Owner

I'm really not sure how useful the older/newer feature is in git-messenger.

I've had a go at implementing this, and I've found the results less than ideal. For example, if a commit introduces a line, git-messenger would blame at the same line despite the fact the line didn't exist in other commits. There were more cases I've found that just gave the wrong results. This all stems from the fact that git blame doesn't give the right information on how to blame lines in older commits. To do this properly, you need to account for line changes by inspecting the hunks of the commit at each blame.

Honestly, I think you are much better off using :Git blame from fugitive.

@ecosse3
Copy link

ecosse3 commented Dec 6, 2021

I found it really useful while working on big projects when many developers maintain code. If you are fixing some bug, it was very easy to find what was the previous implementation on the selected line than searching git_bcommits via telescope/lazygit. Results were always satisfying.

@ambroisie

This comment was marked as resolved.

@lewis6991

This comment was marked as resolved.

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

No branches or pull requests

4 participants