Skip to content

Commit f5a2eec

Browse files
committed
Include git notes in commit buffers
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. This should work for older versions of git, without the notes feature, provided that the '%N' directive is passed through as-is.
1 parent 13fdeb5 commit f5a2eec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

autoload/fugitive.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,11 @@ function! fugitive#BufReadCmd(...) abort
20312031
if b:fugitive_display_format
20322032
call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, rev])
20332033
else
2034-
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])
2034+
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%nFuGiTiVeBeGiNmArKeRNotes:%n%NFuGiTiVeEnDmArKeR', rev])
2035+
silent! keepjumps g/FuGiTiVeEnDmArKeR/norm! kgJ
2036+
silent! keepjumps g/^FuGiTiVeBeGiNmArKeRNotes:\(%N\)\?FuGiTiVeEnDmArKeR$/d
2037+
silent! keepjumps %s/^FuGiTiVeBeGiNmArKeR//
2038+
silent! keepjumps %s/FuGiTiVeEnDmArKeR$//
20352039
keepjumps call search('^parent ')
20362040
if getline('.') ==# 'parent '
20372041
silent keepjumps delete_

0 commit comments

Comments
 (0)