Skip to content

Commit

Permalink
send-email: Identify author at the top when sending e-mail
Browse files Browse the repository at this point in the history
git-send-email did not check if the sender is the same as the
patch author.  Follow the "From: at the beginning" convention to
propagate the patch author correctly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Mar 24, 2006
1 parent b0d08a5 commit 8a8e623
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ sub send_message
foreach my $t (@files) {
open(F,"<",$t) or die "can't open file $t";

my $author_not_sender = undef;
@cc = @initial_cc;
my $found_mbox = 0;
my $header_done = 0;
Expand All @@ -321,7 +322,12 @@ sub send_message
$subject = $1;

} elsif (/^(Cc|From):\s+(.*)$/) {
next if ($2 eq $from && $suppress_from);
if ($2 eq $from) {
next if ($suppress_from);
}
else {
$author_not_sender = $2;
}
printf("(mbox) Adding cc: %s from line '%s'\n",
$2, $_) unless $quiet;
push @cc, $2;
Expand Down Expand Up @@ -360,6 +366,9 @@ sub send_message
}
}
close F;
if (defined $author_not_sender) {
$message = "From: $author_not_sender\n\n$message";
}

$cc = join(", ", unique_email_list(@cc));

Expand Down

0 comments on commit 8a8e623

Please sign in to comment.