Skip to content

Commit

Permalink
send-email: Add some options for controlling how addresses are automa…
Browse files Browse the repository at this point in the history
…tically added to the cc: list.

Signed-off-by: Ryan Anderson <ryan@michonline.com>
  • Loading branch information
Ryan Anderson committed Feb 13, 2006
1 parent bd9ca0b commit a985d59
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Documentation/git-send-email.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ The options available are:
Only necessary if --compose is also set. If --compose
is not set, this will be prompted for.

--no-signed-off-by-cc::
Do not add emails foudn in Signed-off-by: lines to the cc list.

--quiet::
Make git-send-email less verbose. One line per email should be
all that is output.
Expand All @@ -61,6 +64,10 @@ The options available are:
Only necessary if --compose is also set. If --compose
is not set, this will be prompted for.

--suppress-from::
Do not add the From: address to the cc: list, if it shows up in a From:
line.

--to::
Specify the primary recipient of the emails generated.
Generally, this will be the upstream maintainer of the
Expand Down
15 changes: 12 additions & 3 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
my (@to,@cc,$initial_reply_to,$initial_subject,@files,$from,$compose);

# Behavior modification variables
my ($chain_reply_to, $smtp_server, $quiet) = (1, "localhost", 0);
my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, "localhost", 0, 0, 0);

# Example reply to:
#$initial_reply_to = ''; #<20050203173208.GA23964@foobar.com>';
Expand All @@ -52,6 +52,8 @@
"smtp-server=s" => \$smtp_server,
"compose" => \$compose,
"quiet" => \$quiet,
"suppress-from" => \$suppress_from,
"no-signed-off-cc" => \$no_signed_off_cc,
);

# Now, let's fill any that aren't set in with defaults:
Expand Down Expand Up @@ -212,13 +214,19 @@
email sent, rather than to the first email sent.
Defaults to on.
--no-signed-off-cc Suppress the automatic addition of email addresses
that appear in a Signed-off-by: line, to the cc: list.
Note: Using this option is not recommended.
--smtp-server If set, specifies the outgoing SMTP server to use.
Defaults to localhost.
--suppress-from Supress sending emails to yourself if your address
appears in a From: line.
--quiet Make git-send-email less verbose. One line per email should be
all that is output.
Error: Please specify a file or a directory on the command line.
EOT
exit(1);
Expand Down Expand Up @@ -304,6 +312,7 @@ sub send_message
$subject = $1;

} elsif (/^(Cc|From):\s+(.*)$/) {
next if ($2 eq $from && $suppress_from);
printf("(mbox) Adding cc: %s from line '%s'\n",
$2, $_) unless $quiet;
push @cc, $2;
Expand Down Expand Up @@ -332,7 +341,7 @@ sub send_message
}
} else {
$message .= $_;
if (/^Signed-off-by: (.*)$/i) {
if (/^Signed-off-by: (.*)$/i && !$no_signed_off_cc) {
my $c = $1;
chomp $c;
push @cc, $c;
Expand Down

0 comments on commit a985d59

Please sign in to comment.