From 5661dea7be3d176773ed217c424c0d0f5717bd31 Mon Sep 17 00:00:00 2001 From: David Briscoe Date: Wed, 3 Jul 2024 13:30:41 -0700 Subject: [PATCH] Format the full body instead of separating title Fix #2315: Gedit strips newlines when commit lacks a blank line %B is the "raw body (unwrapped subject and body)". Since we're displaying both, we can use that to avoid any changes to the message content. %B was added to git in 1.7.2 (2010) in commit 1367b12ad623e28546ba40c435015d94e7fbb248, and fugitive requires 1.8.5 so it's safe to use. --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 399bd19..4053acf 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -3185,7 +3185,7 @@ function! fugitive#BufReadCmd(...) abort if b:fugitive_display_format call s:ReplaceCmd([dir, 'cat-file', b:fugitive_type, 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: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%B', rev]) keepjumps 1 keepjumps call search('^parent ') if getline('.') ==# 'parent ' -- 2.11.4.GIT