aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-23 23:43:52 -0800
committerJunio C Hamano <junkio@cox.net>2006-03-23 23:43:52 -0800
commit8a8e623514d79f006d9b83c47248435f20d4be2a (patch)
treedf0046e92eaa32daa811faad166182a6d47104e5
parentb0d08a504bee17dfc46f761e166ff2c20c59a91a (diff)
downloadgit-8a8e623514d79f006d9b83c47248435f20d4be2a.tar.gz
git-8a8e623514d79f006d9b83c47248435f20d4be2a.tar.xz
send-email: Identify author at the top when sending e-mail
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>
-rwxr-xr-xgit-send-email.perl11
1 files changed, 10 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 7c8d51223..b220d11cc 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -307,6 +307,7 @@ $subject = $initial_subject;
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;
@@ -321,7 +322,12 @@ foreach my $t (@files) {
$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;
@@ -360,6 +366,9 @@ foreach my $t (@files) {
}
}
close F;
+ if (defined $author_not_sender) {
+ $message = "From: $author_not_sender\n\n$message";
+ }
$cc = join(", ", unique_email_list(@cc));