Skip to content

Commit

Permalink
git-send-email: do not drop custom headers the user prepared
Browse files Browse the repository at this point in the history
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 <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Oct 6, 2006
1 parent abd6970 commit ce91c2f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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, '|-';
Expand Down Expand Up @@ -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 = "";
Expand All @@ -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
Expand Down

0 comments on commit ce91c2f

Please sign in to comment.