Skip to content

Commit f891cb3

Browse files
julliardJunio C Hamano
authored andcommitted
git-format-patch: Always add a blank line between headers and body.
If the second line of the commit message isn't empty, git-format-patch needs to add an empty line in order to generate a properly formatted mail. Otherwise git-rebase drops the rest of the commit message. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 6baf048 commit f891cb3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git-format-patch.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ titleScript='
174174
process_one () {
175175
perl -w -e '
176176
my ($keep_subject, $num, $signoff, $commsg) = @ARGV;
177-
my ($signoff_pattern, $done_header, $done_subject, $signoff_seen,
177+
my ($signoff_pattern, $done_header, $done_subject, $done_separator, $signoff_seen,
178178
$last_was_signoff);
179179
180180
if ($signoff) {
@@ -228,6 +228,11 @@ while (<FH>) {
228228
$done_subject = 1;
229229
next;
230230
}
231+
unless ($done_separator) {
232+
print "\n";
233+
$done_separator = 1;
234+
next if (/^$/);
235+
}
231236
232237
$last_was_signoff = 0;
233238
if (/Signed-off-by:/i) {

0 commit comments

Comments
 (0)