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

[PATCH] send-email: do not insert third header

From
Stepan Kasal <kasal@ucw.cz>
Date
Jun 7, 2014, 08:09 UTC
Message-ID
<20140607080940.GA8858@camelia.ucw.cz>

It is sometimes desirable to insert several header lines at the top of the body, e.g., if From or Date differs from the mail header. (Linus even recommends to use this second header for all kernel submissions.)

send-email has a minimal support for this; make sure it is not applied when there is a second header already inserted in the patch file.

Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
 git-send-email.perl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 9949db0..891df13 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1456,7 +1456,9 @@ foreach my $t (@files) {
 	}
 
 	if (defined $sauthor and $sauthor ne $sender) {
-		$message = "From: $author\n\n$message";
+		if ($message !~ m/^From: /) {
+			$message = "From: $author\n\n$message";
+		}
 		if (defined $author_encoding) {
 			if ($has_content_type) {
 				if ($body_encoding eq $author_encoding) {
-- 
1.9.2.msysgit.0.496.g9a846d6
Next: Junio C Hamano
Message 1 of 4 in “send-email: do not insert third header”
  1. send-email: do not insert third headerStepan Kasal, Jun 7, 2014
  2. Junio C HamanoJun 9, 2014
  3. Junio C HamanoJun 10, 2014
  4. Stepan KasalJun 10, 2014

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.