{"thread":{"id":"35049","subject":"[PATCH] git-send-email: two new options: to-cover, cc-cover","startedAt":"2013-10-02T06:08:52Z","lastAt":"2013-10-02T06:08:52Z","messageCount":1,"participants":["Michael S. Tsirkin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"228514","messageId":"20131002060852.GA29574@redhat.com","threadId":"35049","inReplyTo":null,"subject":"[PATCH] git-send-email: two new options: to-cover, cc-cover","fromName":"Michael S. Tsirkin","fromEmail":"mst@redhat.com","sentAt":"2013-10-02T06:08:52Z","receivedAt":"2013-10-02T06:08:52Z","isPatch":true,"sender":{"key":"mst@kernel.org","avatar":null},"body":"Allow extracting To/Cc addresses from cover letter.\n\nSigned-off-by: Michael S. Tsirkin <mst@redhat.com>\n---\n\nIs there interest in this kind of feature?\nI find it easier than adding --cc to send-email command line.\n\n git-send-email.perl | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex faf93fc..9c6ed29 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -80,6 +80,8 @@ git send-email [options] <file | directory | rev-list options >\n     --to-cmd                <str>  * Email To: via `<str> \\$patch_path`\n     --cc-cmd                <str>  * Email Cc: via `<str> \\$patch_path`\n     --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, all.\n+    --[no-]cc-cover                * Email Cc: addresses in the cover letter.\n+    --[no-]to-cover                * Email To: addresses in the cover letter. Default on.\n     --[no-]signed-off-by-cc        * Send to Signed-off-by: addresses. Default on.\n     --[no-]suppress-from           * Send to self. Default off.\n     --[no-]chain-reply-to          * Chain In-Reply-To: fields. Default off.\n@@ -195,6 +197,7 @@ sub do_edit {\n \n # Variables with corresponding config settings\n my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc);\n+my ($cover_cc, $cover_to);\n my ($to_cmd, $cc_cmd);\n my ($smtp_server, $smtp_server_port, @smtp_server_options);\n my ($smtp_authuser, $smtp_encryption, $smtp_ssl_cert_path);\n@@ -211,6 +214,8 @@ my %config_bool_settings = (\n     \"chainreplyto\" => [\\$chain_reply_to, 0],\n     \"suppressfrom\" => [\\$suppress_from, undef],\n     \"signedoffbycc\" => [\\$signed_off_by_cc, undef],\n+    \"cccover\" => [\\$cover_cc, undef],\n+    \"tocover\" => [\\$cover_to, undef],\n     \"signedoffcc\" => [\\$signed_off_by_cc, undef],      # Deprecated\n     \"validate\" => [\\$validate, 1],\n     \"multiedit\" => [\\$multiedit, undef],\n@@ -302,6 +307,8 @@ my $rc = GetOptions(\"h\" => \\$help,\n \t\t    \"suppress-from!\" => \\$suppress_from,\n \t\t    \"suppress-cc=s\" => \\@suppress_cc,\n \t\t    \"signed-off-cc|signed-off-by-cc!\" => \\$signed_off_by_cc,\n+\t\t    \"cc-cover|cc-cover!\" => \\$cover_cc,\n+\t\t    \"to-cover|to-cover!\" => \\$cover_to,\n \t\t    \"confirm=s\" => \\$confirm,\n \t\t    \"dry-run\" => \\$dry_run,\n \t\t    \"envelope-sender=s\" => \\$envelope_sender,\n@@ -1464,6 +1471,15 @@ foreach my $t (@files) {\n \t@to = (@initial_to, @to);\n \t@cc = (@initial_cc, @cc);\n \n+\tif ($message_num == 1) {\n+\t\tif (defined $cover_cc and $cover_cc) {\n+\t\t\t@initial_cc = @cc;\n+\t\t}\n+\t\tif (not defined $cover_to or $cover_to) {\n+\t\t\t@initial_to = @to;\n+\t\t}\n+\t}\n+\n \tmy $message_was_sent = send_message();\n \n \t# set up for the next message\n-- \nMST\n"}]}