Skip to content

Commit

Permalink
Issue tpope#2217 Include commit hash and refs in commit display
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jesse Byler committed Sep 27, 2023
1 parent 99db68d commit f417e4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autoload/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3174,9 +3174,10 @@ function! fugitive#BufReadCmd(...) abort
elseif b:fugitive_type ==# 'commit'
let b:fugitive_display_format = b:fugitive_display_format % 2
if b:fugitive_display_format
call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev])
" call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev])
call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', '-c', 'log.showRoot=false', 'show', '--no-color', '-m', '--first-parent', '--no-patch', '--pretty=format:commit%x20%H%d%ntree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%n%n%s%n%n%b', rev])
else
call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', '-c', 'log.showRoot=false', 'show', '--no-color', '-m', '--first-parent', '--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev])
call s:ReplaceCmd([dir, '-c', 'diff.noprefix=false', '-c', 'log.showRoot=false', 'show', '--no-color', '-m', '--first-parent', '--pretty=format:commit%x20%H%d%ntree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b', rev])
keepjumps 1
keepjumps call search('^parent ')
if getline('.') ==# 'parent '
Expand Down

0 comments on commit f417e4c

Please sign in to comment.