Skip to content

Commit

Permalink
Include git notes in commit buffers
Browse files Browse the repository at this point in the history
Issue #912

Add any existing git notes into commit views, between the commit message and
the patch itself.  This is similar to what "git show" does, albeit without any
indent.

Calling "git notes list" serves both to suppress the "Notes:" prefix when a
commit does not have any notes, and to avoid using notes formats in older
versions of git that do not support the feature.
  • Loading branch information
a-m-s committed Nov 25, 2019
1 parent 13fdeb5 commit c043683
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autoload/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,9 @@ function! fugitive#BufReadCmd(...) abort
if b:fugitive_display_format
call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev])
else
call s:ReplaceCmd([dir, '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])
let [note, exec_error] = s:ChompError([dir, 'notes', 'list', rev])
let noteformat = (exec_error ? '' : '%nNotes:%n%N')
call s:ReplaceCmd([dir, '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' . noteformat, rev])
keepjumps call search('^parent ')
if getline('.') ==# 'parent '
silent keepjumps delete_
Expand Down

0 comments on commit c043683

Please sign in to comment.