@@ -64,17 +64,16 @@ sub usage {
64
64
email sent, rather than to the first email sent.
65
65
Defaults to on.
66
66
67
- --no-signed-off-cc Suppress the automatic addition of email addresses
68
- that appear in Signed-off-by: or Cc: lines to the cc:
69
- list. Note: Using this option is not recommended.
67
+ --signed-off-cc Automatically add email addresses that appear in
68
+ Signed-off-by: or Cc: lines to the cc: list. Defaults to on.
70
69
71
70
--smtp-server If set, specifies the outgoing SMTP server to use.
72
71
Defaults to localhost.
73
72
74
73
--suppress-from Suppress sending emails to yourself if your address
75
- appears in a From: line.
74
+ appears in a From: line. Defaults to off.
76
75
77
- --threaded Specify that the "In-Reply-To:" header should be set on all
76
+ --thread Specify that the "In-Reply-To:" header should be set on all
78
77
emails. Defaults to on.
79
78
80
79
--quiet Make git-send-email less verbose. One line per email
@@ -140,9 +139,6 @@ sub format_2822_time {
140
139
my (@to ,@cc ,@initial_cc ,@bcclist ,@xh ,
141
140
$initial_reply_to ,$initial_subject ,@files ,$from ,$compose ,$time );
142
141
143
- # Behavior modification variables
144
- my ($threaded , $chain_reply_to , $quiet , $suppress_from , $no_signed_off_cc ,
145
- $dry_run ) = (1, 1, 0, 0, 0, 0);
146
142
my $smtp_server ;
147
143
my $envelope_sender ;
148
144
@@ -157,16 +153,22 @@ sub format_2822_time {
157
153
$term = new FakeTerm " $@ : going non-interactive" ;
158
154
}
159
155
156
+ # Behavior modification variables
157
+ my ($quiet , $dry_run ) = (0, 0);
158
+
159
+ # Variables with corresponding config settings
160
+ my ($thread , $chain_reply_to , $suppress_from , $signed_off_cc );
161
+
160
162
my %config_settings = (
161
- " threaded" => \$threaded ,
162
- " chainreplyto" => \$chain_reply_to ,
163
+ " thread" => [\$thread , 1],
164
+ " chainreplyto" => [\$chain_reply_to , 1],
165
+ " suppressfrom" => [\$suppress_from , 0],
166
+ " signedoffcc" => [\$signed_off_cc , 1],
163
167
);
164
168
165
169
foreach my $setting (keys %config_settings ) {
166
- my $default = $repo -> config_bool(" sendemail.$setting " );
167
- if (defined $default ) {
168
- $config_settings {$setting } = $default ? 1 : 0;
169
- }
170
+ my $config = $repo -> config_bool(" sendemail.$setting " );
171
+ ${$config_settings {$setting }-> [0]} = (defined $config ) ? $config : $config_settings {$setting }-> [1];
170
172
}
171
173
172
174
@bcclist = $repo -> config(' sendemail.bcc' );
@@ -187,11 +189,11 @@ sub format_2822_time {
187
189
" smtp-server=s" => \$smtp_server ,
188
190
" compose" => \$compose ,
189
191
" quiet" => \$quiet ,
190
- " suppress-from" => \$suppress_from ,
191
- " no- signed-off-cc|no- signed-off-by-cc" => \$no_signed_off_cc ,
192
+ " suppress-from! " => \$suppress_from ,
193
+ " signed-off-cc|signed-off-by-cc! " => \$signed_off_cc ,
192
194
" dry-run" => \$dry_run ,
193
195
" envelope-sender=s" => \$envelope_sender ,
194
- " threaded !" => \$threaded ,
196
+ " thread !" => \$thread ,
195
197
);
196
198
197
199
unless ($rc ) {
@@ -298,7 +300,7 @@ sub expand_aliases {
298
300
$prompting ++;
299
301
}
300
302
301
- if ($threaded && !defined $initial_reply_to && $prompting ) {
303
+ if ($thread && !defined $initial_reply_to && $prompting ) {
302
304
do {
303
305
$_ = $term -> readline(" Message-ID to be used as In-Reply-To for the first email? " ,
304
306
$initial_reply_to );
@@ -495,7 +497,7 @@ sub send_message
495
497
Message-Id: $message_id
496
498
X-Mailer: git-send-email $gitversion
497
499
" ;
498
- if ($threaded && $reply_to ) {
500
+ if ($thread && $reply_to ) {
499
501
500
502
$header .= " In-Reply-To: $reply_to \n " ;
501
503
$header .= " References: $references \n " ;
@@ -620,7 +622,7 @@ sub send_message
620
622
}
621
623
} else {
622
624
$message .= $_ ;
623
- if (/ ^(Signed-off-by|Cc): (.*)$ /i && ! $no_signed_off_cc ) {
625
+ if (/ ^(Signed-off-by|Cc): (.*)$ /i && $signed_off_cc ) {
624
626
my $c = $2 ;
625
627
chomp $c ;
626
628
push @cc , $c ;
0 commit comments