send-email: apply --suppress-from to S-o-b and cc-cmd
Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com> Cc: Ryan Anderson <ryan@michonline.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Uwe Kleine-König committed
Nov 7, 2007 at 08:34 UTC
620bb245b945531bb6e08016d5f28caf9e797786
2 files changed
+4
-4
Documentation/git-send-email.txt
+1
-2
@@ -113,8 +113,7 @@ The --cc option must be repeated for each user you want on the cc list.
113
is not set, this will be prompted for.
114
115
--suppress-from, --no-suppress-from::
116
- If this is set, do not add the From: address to the cc: list, if it
117
- shows up in a From: line.
116
+ If this is set, do not add the From: address to the cc: list.
117
Default is the value of 'sendemail.suppressfrom' configuration value;
118
if that is unspecified, default to --no-suppress-from.
119
git-send-email.perl
+3
-2
@@ -88,8 +88,7 @@ Options:
88
89
--smtp-ssl If set, connects to the SMTP server using SSL.
90
91
- --suppress-from Suppress sending emails to yourself if your address
92
- appears in a From: line. Defaults to off.
91
+ --suppress-from Suppress sending emails to yourself. Defaults to off.
92
93
--thread Specify that the "In-Reply-To:" header should be set on all
94
emails. Defaults to on.
@@ -730,6 +729,7 @@ foreach my $t (@files) {
729
if (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) {
730
my $c = $2;
731
chomp $c;
732
+ next if ($c eq $sender and $suppress_from);
733
push @cc, $c;
734
printf("(sob) Adding cc: %s from line '%s'\n",
735
$c, $_) unless $quiet;
@@ -745,6 +745,7 @@ foreach my $t (@files) {
745
my $c = $_;
746
$c =~ s/^\s*//g;
747
$c =~ s/\n$//g;
748
+ next if ($c eq $sender and $suppress_from);
749
push @cc, $c;
750
printf("(cc-cmd) Adding cc: %s from: '%s'\n",
751
$c, $cc_cmd) unless $quiet;