X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-send-email.perl;h=b220d11cc1e92e50b3c25460f84ab5db12a04da1;hb=bdaa085f8c33e75cf477ff6b4292f35c9c5f4c22;hp=b0d095b4e95bb665602d3527068341f41ccdf66a;hpb=70e1cca3886b2efac5bcd42065bde45395dd92c7;p=git.git diff --git a/git-send-email.perl b/git-send-email.perl index b0d095b4..b220d11c 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -54,7 +54,7 @@ my $rc = GetOptions("from=s" => \$from, "compose" => \$compose, "quiet" => \$quiet, "suppress-from" => \$suppress_from, - "no-signed-off-cc" => \$no_signed_off_cc, + "no-signed-off-cc|no-signed-off-by-cc" => \$no_signed_off_cc, ); # Now, let's fill any that aren't set in with defaults: @@ -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));