From: Junio C Hamano Date: Thu, 5 Oct 2006 23:36:49 +0000 (-0700) Subject: git-send-email: do not drop custom headers the user prepared X-Git-Tag: v1.4.4-rc1~85^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ce91c2f6538fc4a905882f2a7a57d814d82b13e8?hp=abd6970acad5d758f48c13f7420367ae8216038e git-send-email: do not drop custom headers the user prepared The command picked up only Subject, CC, and From headers in the incoming mbox text. Sending out patches prepared by git-format-patch with user's custom headers was impossible with that. Just keep the ones it does not need to look at and add them to the header of the message when sending it out. Signed-off-by: Junio C Hamano --- diff --git a/git-send-email.perl b/git-send-email.perl index 3f50abaeb6..2fd5e87934 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -83,7 +83,7 @@ sub format_2822_time { 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 @@ sub send_message $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 @@ sub send_message my $author_not_sender = undef; @cc = @initial_cc; + @xh = (); my $found_mbox = 0; my $header_done = 0; $message = ""; @@ -495,6 +499,9 @@ sub send_message $2, $_) unless $quiet; push @cc, $2; } + elsif (/^[-A-Za-z]+:\s+\S/) { + push @xh, $_; + } } else { # In the traditional