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>
This commit is contained in:
Uwe Kleine-König 2007-11-07 08:34:12 +01:00 committed by Junio C Hamano
parent 3c307bfbe8
commit 620bb245b9
2 changed files with 4 additions and 4 deletions

View File

@ -113,8 +113,7 @@ The --cc option must be repeated for each user you want on the cc list.
is not set, this will be prompted for. is not set, this will be prompted for.
--suppress-from, --no-suppress-from:: --suppress-from, --no-suppress-from::
If this is set, do not add the From: address to the cc: list, if it If this is set, do not add the From: address to the cc: list.
shows up in a From: line.
Default is the value of 'sendemail.suppressfrom' configuration value; Default is the value of 'sendemail.suppressfrom' configuration value;
if that is unspecified, default to --no-suppress-from. if that is unspecified, default to --no-suppress-from.

View File

@ -88,8 +88,7 @@ Options:
--smtp-ssl If set, connects to the SMTP server using SSL. --smtp-ssl If set, connects to the SMTP server using SSL.
--suppress-from Suppress sending emails to yourself if your address --suppress-from Suppress sending emails to yourself. Defaults to off.
appears in a From: line. Defaults to off.
--thread Specify that the "In-Reply-To:" header should be set on all --thread Specify that the "In-Reply-To:" header should be set on all
emails. Defaults to on. emails. Defaults to on.
@ -730,6 +729,7 @@ foreach my $t (@files) {
if (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) { if (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) {
my $c = $2; my $c = $2;
chomp $c; chomp $c;
next if ($c eq $sender and $suppress_from);
push @cc, $c; push @cc, $c;
printf("(sob) Adding cc: %s from line '%s'\n", printf("(sob) Adding cc: %s from line '%s'\n",
$c, $_) unless $quiet; $c, $_) unless $quiet;
@ -745,6 +745,7 @@ foreach my $t (@files) {
my $c = $_; my $c = $_;
$c =~ s/^\s*//g; $c =~ s/^\s*//g;
$c =~ s/\n$//g; $c =~ s/\n$//g;
next if ($c eq $sender and $suppress_from);
push @cc, $c; push @cc, $c;
printf("(cc-cmd) Adding cc: %s from: '%s'\n", printf("(cc-cmd) Adding cc: %s from: '%s'\n",
$c, $cc_cmd) unless $quiet; $c, $cc_cmd) unless $quiet;