git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-format-patch: Always add a blank line between headers and body.

From
AJAlexandre Julliard <julliard@winehq.org>
Date
Feb 27, 2006, 13:09 UTC
Message-ID
<874q2lhrrv.fsf@wine.dyndns.org>

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>
---
 git-format-patch.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
dcd0ed6ced98990c92a32416c0acc3ec298f5b91
diff --git a/git-format-patch.sh b/git-format-patch.sh
index eb75de4..2bd2639 100755
--- a/git-format-patch.sh
+++ b/git-format-patch.sh
@@ -174,7 +174,7 @@ titleScript='
 process_one () {
 	perl -w -e '
 my ($keep_subject, $num, $signoff, $commsg) = @ARGV;
-my ($signoff_pattern, $done_header, $done_subject, $signoff_seen,
+my ($signoff_pattern, $done_header, $done_subject, $done_separator, $signoff_seen,
     $last_was_signoff);
 
 if ($signoff) {
@@ -228,6 +228,11 @@ while (<FH>) {
 	$done_subject = 1;
 	next;
     }
+    unless ($done_separator) {
+        print "\n";
+        $done_separator = 1;
+        next if (/^$/);
+    }
 
     $last_was_signoff = 0;
     if (/Signed-off-by:/i) {
-- 
1.2.3.gb348-dirty


-- 
Alexandre Julliard
julliard@winehq.org
Message 1 of 1 in “git-format-patch: Always add a blank line between headers and body.”
  1. git-format-patch: Always add a blank line between headers and body.Alexandre Julliard, Feb 27, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.