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] Include commit hash when showing a commit #2217

Open
jbyler opened this issue Sep 27, 2023 · 0 comments
Open

[Feature Request] Include commit hash when showing a commit #2217

jbyler opened this issue Sep 27, 2023 · 0 comments

Comments

@jbyler
Copy link

jbyler commented Sep 27, 2023

When displaying a commit object, vim-fugitive calls git show with a pretty format that imitates what git cat-file commit shows: it includes the tree hash, parent hash, author info, and committer info.

My feature request is to add the commit hash to the pretty format, and ideally also the ref description.

Justification: when viewing info about a commit, I'd like easy access to which commit I'm looking at. I might want to yank the commit hash to use elsewhere, for example.

I'm happy to submit a PR for this if you'll accept it. The PR will do 2 things:

  1. add commit%x20%H%d%n to the start of the pretty format
  2. replace git cat-file commit <rev> with a modified git show command in the code branch for when b:fugitive_display_format is set, so that the format will still match when pressing a or i

I'm testing this locally and it seems to work fine. I can keep it as a local patch I suppose if you don't think this feature will benefit other users.

jbyler pushed a commit to jbyler/vim-fugitive that referenced this issue Sep 27, 2023
When displaying a commit, add a new line showing the commit hash and refs
description.

Also switches from using `git cat-file commit` to using `git show --no-patch`
for the short form toggled with `a` or `i` to keep the format consistent.
@jbyler jbyler changed the title Include commit hash when showing a commit Feature Reqeust: Include commit hash when showing a commit Sep 27, 2023
@jbyler jbyler changed the title Feature Reqeust: Include commit hash when showing a commit [Feature Reqeust] Include commit hash when showing a commit Sep 27, 2023
@jbyler jbyler changed the title [Feature Reqeust] Include commit hash when showing a commit [Feature Request] Include commit hash when showing a commit Sep 27, 2023
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

1 participant