Skip to content

Commit

Permalink
Format the full body instead of separating title
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
idbrii committed Jul 3, 2024
1 parent 0e95f98 commit 9164ea4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down

0 comments on commit 9164ea4

Please sign in to comment.