From f5a2eec115283944e3d6a848a0b2f82687a28b79 Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Thu, 21 Nov 2019 23:40:55 +0000 Subject: [PATCH] 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. --- autoload/fugitive.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 2b050562f6..faa7017329 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2031,7 +2031,11 @@ 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]) + 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]) + silent! keepjumps g/FuGiTiVeEnDmArKeR/norm! kgJ + silent! keepjumps g/^FuGiTiVeBeGiNmArKeRNotes:\(%N\)\?FuGiTiVeEnDmArKeR$/d + silent! keepjumps %s/^FuGiTiVeBeGiNmArKeR// + silent! keepjumps %s/FuGiTiVeEnDmArKeR$/ / keepjumps call search('^parent ') if getline('.') ==# 'parent ' silent keepjumps delete_