git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/2] git-send-email: two new options: to-cover, cc-cover

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 3, 2014, 21:24 UTC
Message-ID
<CAPig+cQB4iTH8W-4HFrRk5KQe5OrBaz0WN24iYWqRrHCq5u4rA@mail.gmail.com>
In-Reply-To
<1396548814-27278-1-git-send-email-mst@redhat.com>
On Thu, Apr 3, 2014 at 2:14 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
Show 19 quoted lines
> Allow extracting To/Cc addresses from cover letter.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  Documentation/git-send-email.txt | 12 ++++++++++++
>  git-send-email.perl              | 16 ++++++++++++++++
>  2 files changed, 28 insertions(+)
>
> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
> index f0e57a5..1733664 100644
> --- a/Documentation/git-send-email.txt
> +++ b/Documentation/git-send-email.txt
> @@ -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 cover letter are
> +       added to the cc list for each email set. Default is the value of
s/email set/email sent/
Show 6 quoted lines
> +       '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 cover letter are
> +       added to the to list for each email set. Default is the value of
Ditto.
Show 68 quoted lines
> +       '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:
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 8bbfb84..11d9a46 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -80,6 +80,8 @@ git send-email [options] <file | directory | rev-list options >
>      --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 @@ my %config_bool_settings = (
>      "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 @@ my $rc = GetOptions("h" => \$help,
>                     "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,
> @@ -1468,6 +1475,15 @@ foreach my $t (@files) {
>         @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
> --
> MST
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Michael S. Tsirkin
Message 6 of 6 in “git-send-email: two new options: to-cover, cc-cover”
  1. 1/2 git-send-email: two new options: to-cover, cc-coverMichael S. Tsirkin, Apr 3, 2014
  2. 2/2 test/send-email: add to-cover testMichael S. Tsirkin, Apr 3, 2014
  3. Junio C HamanoApr 3, 2014
  4. Junio C HamanoApr 3, 2014
  5. Michael S. TsirkinApr 27, 2014
  6. Eric SunshineApr 3, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.