send-email: Add some options for controlling how addresses are automatically added to the cc: list.
Signed-off-by: Ryan Anderson <ryan@michonline.com>
Ryan Anderson committed
Feb 13, 2006 at 02:57 UTC
a985d595ada7914e217cbec75470f2950d41505b
2 files changed
+19
-3
Documentation/git-send-email.txt
+7
@@ -48,6 +48,9 @@ The options available are:
48
Only necessary if --compose is also set. If --compose
49
is not set, this will be prompted for.
50
51
+--no-signed-off-by-cc::
52
+ Do not add emails foudn in Signed-off-by: lines to the cc list.
53
+
54
--quiet::
55
Make git-send-email less verbose. One line per email should be
56
all that is output.
@@ -61,6 +64,10 @@ The options available are:
64
Only necessary if --compose is also set. If --compose
65
is not set, this will be prompted for.
66
67
+--suppress-from::
68
+ Do not add the From: address to the cc: list, if it shows up in a From:
69
+ line.
70
+
71
--to::
72
Specify the primary recipient of the emails generated.
73
Generally, this will be the upstream maintainer of the
git-send-email.perl
+12
-3
@@ -34,7 +34,7 @@ my $compose_filename = ".msg.$$";
34
my (@to,@cc,$initial_reply_to,$initial_subject,@files,$from,$compose);
35
36
# Behavior modification variables
37
-my ($chain_reply_to, $smtp_server, $quiet) = (1, "localhost", 0);
37
+my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, "localhost", 0, 0, 0);
38
39
# Example reply to:
40
#$initial_reply_to = ''; #<20050203173208.GA23964@foobar.com>';
@@ -52,6 +52,8 @@ my $rc = GetOptions("from=s" => \$from,
52
"smtp-server=s" => \$smtp_server,
53
"compose" => \$compose,
54
"quiet" => \$quiet,
55
+ "suppress-from" => \$suppress_from,
56
+ "no-signed-off-cc" => \$no_signed_off_cc,
57
);
58
59
# Now, let's fill any that aren't set in with defaults:
@@ -212,13 +214,19 @@ Options:
214
email sent, rather than to the first email sent.
215
Defaults to on.
216
217
+ --no-signed-off-cc Suppress the automatic addition of email addresses
218
+ that appear in a Signed-off-by: line, to the cc: list.
219
+ Note: Using this option is not recommended.
220
+
221
--smtp-server If set, specifies the outgoing SMTP server to use.
222
Defaults to localhost.
223
224
+ --suppress-from Supress sending emails to yourself if your address
225
+ appears in a From: line.
226
+
227
--quiet Make git-send-email less verbose. One line per email should be
228
all that is output.
229
221
-
230
Error: Please specify a file or a directory on the command line.
231
EOT
232
exit(1);
@@ -304,6 +312,7 @@ foreach my $t (@files) {
312
$subject = $1;
313
314
} elsif (/^(Cc|From):\s+(.*)$/) {
315
+ next if ($2 eq $from && $suppress_from);
316
printf("(mbox) Adding cc: %s from line '%s'\n",
317
$2, $_) unless $quiet;
318
push @cc, $2;
@@ -332,7 +341,7 @@ foreach my $t (@files) {
341
}
342
} else {
343
$message .= $_;
335
- if (/^Signed-off-by: (.*)$/i) {
344
+ if (/^Signed-off-by: (.*)$/i && !$no_signed_off_cc) {
345
my $c = $1;
346
chomp $c;
347
push @cc, $c;