Re: git-send-email w/ headers
- From
Junio C Hamano <junkio@cox.net>
- Date
- Oct 6, 2006, 06:09 UTC
- Message-ID
- <7v1wpm2cxd.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <200610060041.56807.len.brown@intel.com>
Len Brown <len.brown@intel.com> writes:
> But the Signed-off-by: line from the original message body has > now been swallowed up into the message header -- so my mailer > doesn't display it.
Sorry, what I sent out has worse breakage than not having your custom header. It would eat the first paragraph of your message X-<.
A replacement patch is attached. If you have already applied the previous patch, you can hand edit the line that says:
$header .= join("\n", @xh);to
$header .= join("\n", @xh) . "\n";It forgets to end the last line of the headers with LF.
---
diff --git a/git-send-email.perl b/git-send-email.perl index 3f50aba..2fd5e87 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -83,7 +83,7 @@ # Constants (essentially) my $compose_filename = ".msg.$$"; # Variables we fill in automatically, or via prompting: -my (@to,@cc,@initial_cc,@bcclist, +my (@to,@cc,@initial_cc,@bcclist,@xh, $initial_reply_to,$initial_subject,@files,$from,$compose,$time); # Behavior modification variables @@ -422,6 +422,9 @@ X-Mailer: git-send-email $gitversion $header .= "In-Reply-To: $reply_to\n"; $header .= "References: $references\n"; } + if (@xh) { + $header .= join("\n", @xh) . "\n"; + } if ($smtp_server =~ m#^/#) { my $pid = open my $sm, '|-'; @@ -472,6 +475,7 @@ foreach my $t (@files) { my $author_not_sender = undef; @cc = @initial_cc; + @xh = (); my $found_mbox = 0; my $header_done = 0; $message = ""; @@ -495,6 +499,9 @@ foreach my $t (@files) { $2, $_) unless $quiet; push @cc, $2; } + elsif (/^[-A-Za-z]+:\s+\S/) { + push @xh, $_; + } } else { # In the traditional