-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gedit strips newlines when commit lacks a blank line #2315
Comments
This is the the same thing that |
Yup. I see. It's due to the massive format in this line setting up a vim-fugitive/autoload/fugitive.vim Line 3188 in d0c1a43
|
Fix tpope#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.
Fix tpope#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.
I use git-svn on a project that don't follow good commit message formatting. We frequently have commit messages that are mostly nicely formatted -- except for the "one blank line" rule. Git generally handles this fine, but fugitive does not.
:Gedit HEAD
(or navigating:G blame
and other commands that view a commit) will put the entire commit message on one line if it doesn't have a blank line after the first line.git log --online
also dumps it on one line.:G show HEAD
displays with expected newlines -- probably because it includes text from git verbatim?Example commit message:
Looks similar with
:G show HEAD
(but indented). However,:Gedit HEAD
results in one massive line:Tested on fugitive latest: d0c1a43. Used gvim on Win10 and vim on Ubuntu 22.04.4 LTS (WSL).
Minimal vimrc:
The text was updated successfully, but these errors were encountered: