1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 17:36:18 +02:00

git-send-email: two new options: to-cover, cc-cover

Allow extracting To/Cc addresses from the first patch
(typically the cover letter), and use them as To/Cc addresses of the
remainder of the series.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael S. Tsirkin 2014-04-29 08:41:16 +03:00 committed by Junio C Hamano
parent d8779e1e25
commit f515c904fb
2 changed files with 28 additions and 0 deletions

View File

@ -248,6 +248,18 @@ Automating
cc list. Default is the value of 'sendemail.signedoffbycc' configuration
value; if that is unspecified, default to --signed-off-by-cc.
--[no-]cc-cover::
If this is set, emails found in Cc: headers in the first patch of
the series (typically the cover letter) are added to the cc list
for each email set. Default is the value of 'sendemail.cccover'
configuration value; if that is unspecified, default to --no-cc-cover.
--[no-]to-cover::
If this is set, emails found in To: headers in the first patch of
the series (typically the cover letter) are added to the to list
for each email set. Default is the value of 'sendemail.tocover'
configuration value; if that is unspecified, default to --no-to-cover.
--suppress-cc=<category>::
Specify an additional category of recipients to suppress the
auto-cc of:

View File

@ -80,6 +80,8 @@ sub usage {
--to-cmd <str> * Email To: via `<str> \$patch_path`
--cc-cmd <str> * Email Cc: via `<str> \$patch_path`
--suppress-cc <str> * author, self, sob, cc, cccmd, body, bodycc, all.
--[no-]cc-cover * Email Cc: addresses in the cover letter.
--[no-]to-cover * Email To: addresses in the cover letter.
--[no-]signed-off-by-cc * Send to Signed-off-by: addresses. Default on.
--[no-]suppress-from * Send to self. Default off.
--[no-]chain-reply-to * Chain In-Reply-To: fields. Default off.
@ -195,6 +197,7 @@ sub do_edit {
# Variables with corresponding config settings
my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc);
my ($cover_cc, $cover_to);
my ($to_cmd, $cc_cmd);
my ($smtp_server, $smtp_server_port, @smtp_server_options);
my ($smtp_authuser, $smtp_encryption, $smtp_ssl_cert_path);
@ -211,6 +214,8 @@ sub do_edit {
"chainreplyto" => [\$chain_reply_to, 0],
"suppressfrom" => [\$suppress_from, undef],
"signedoffbycc" => [\$signed_off_by_cc, undef],
"cccover" => [\$cover_cc, undef],
"tocover" => [\$cover_to, undef],
"signedoffcc" => [\$signed_off_by_cc, undef], # Deprecated
"validate" => [\$validate, 1],
"multiedit" => [\$multiedit, undef],
@ -302,6 +307,8 @@ sub signal_handler {
"suppress-from!" => \$suppress_from,
"suppress-cc=s" => \@suppress_cc,
"signed-off-cc|signed-off-by-cc!" => \$signed_off_by_cc,
"cc-cover|cc-cover!" => \$cover_cc,
"to-cover|to-cover!" => \$cover_to,
"confirm=s" => \$confirm,
"dry-run" => \$dry_run,
"envelope-sender=s" => \$envelope_sender,
@ -1469,6 +1476,15 @@ sub send_message {
@to = (@initial_to, @to);
@cc = (@initial_cc, @cc);
if ($message_num == 1) {
if (defined $cover_cc and $cover_cc) {
@initial_cc = @cc;
}
if (defined $cover_to and $cover_to) {
@initial_to = @to;
}
}
my $message_was_sent = send_message();
# set up for the next message