Re: [PATCH] git-send-email: Don't set author_not_sender from Cc: lines
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:37
Subsystem:
the rest · Maintainer:
Linus Torvalds
Haavard Skinnemoen [off-list ref] writes:
When an mbox-style patch contains a Cc: line in the header, git-send-email will check the address against the sender specified on the command line. If they don't match, sender_not_author will be set to the address obtained from the Cc line.
quoted hunk ↗ jump to hunk
@@ -506,7 +506,7 @@ foreach my $t (@files) { if (/^Subject:\s+(.*)$/) { $subject = $1; - } elsif (/^(Cc|From):\s+(.*)$/) { + } elsif (/^(From):\s+(.*)$/) { if ($2 eq $from) { next if ($suppress_from); }@@ -516,8 +516,11 @@ foreach my $t (@files) { printf("(mbox) Adding cc: %s from line '%s'\n", $2, $_) unless $quiet; push @cc, $2; + } elsif (/^(Cc):\s+(.*)$/) { + printf("(mbox) Adding cc: %s from line '%s'\n", + $2, $_) unless $quiet; + push @cc, $2; } - } else { # In the traditional # "send lots of email" format,
The patch looks wrong. If your name is on CC: and you want to suppress sending to yourself what happens? How about doing something like this instead?
diff --git a/git-send-email.perl b/git-send-email.perl
index a83c7e9..8adb6b9 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl@@ -510,7 +510,7 @@ foreach my $t (@files) { if ($2 eq $from) { next if ($suppress_from); } - else { + elsif ($1 eq 'From') { $author_not_sender = $2; } printf("(mbox) Adding cc: %s from line '%s'\n",