{"thread":{"id":"3318","subject":"[PATCH 2/2] send-email: Add --cc","startedAt":"2006-02-13T08:22:04Z","lastAt":"2006-02-13T08:22:04Z","messageCount":2,"participants":["Ryan Anderson"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"16026","messageId":"1139818924460-git-send-email-ryan@michonline.com","threadId":"3318","inReplyTo":"11398189241095-git-send-email-ryan@michonline.com","subject":"[PATCH 2/2] send-email: Add --cc","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-02-13T08:22:04Z","receivedAt":"2006-02-13T08:22:04Z","isPatch":true,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"Since Junio used this in an example, and I've personally tried to use it, I\nsuppose the option should actually exist.\n\nSigned-off-by: Ryan Anderson <ryan@michonline.com>\n\n---\n\n Documentation/git-send-email.txt |    3 +++\n git-send-email.perl              |    8 ++++++--\n 2 files changed, 9 insertions(+), 2 deletions(-)\n\n6d18725b9d46259162cfe54c9e0e369558394816\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex c2f52f5..8c58685 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -24,6 +24,9 @@ OPTIONS\n -------\n The options available are:\n \n+--cc::\n+\tSpecify a starting \"Cc:\" value for each email.\n+\n --chain-reply-to, --no-chain-reply-to::\n \tIf this is set, each email will be sent as a reply to the previous\n \temail sent.  If disabled with \"--no-chain-reply-to\", all emails after\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex abffca5..13b85dd 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -31,7 +31,7 @@ sub cleanup_compose_files();\n my $compose_filename = \".msg.$$\";\n \n # Variables we fill in automatically, or via prompting:\n-my (@to,@cc,$initial_reply_to,$initial_subject,@files,$from,$compose);\n+my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose);\n \n # Behavior modification variables\n my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, \"localhost\", 0, 0, 0);\n@@ -48,6 +48,7 @@ my $rc = GetOptions(\"from=s\" => \\$from,\n                     \"in-reply-to=s\" => \\$initial_reply_to,\n \t\t    \"subject=s\" => \\$initial_subject,\n \t\t    \"to=s\" => \\@to,\n+\t\t    \"cc=s\" => \\@initial_cc,\n \t\t    \"chain-reply-to!\" => \\$chain_reply_to,\n \t\t    \"smtp-server=s\" => \\$smtp_server,\n \t\t    \"compose\" => \\$compose,\n@@ -199,6 +200,9 @@ Options:\n \n    --to           Specify the primary \"To:\" line of the email.\n \n+   --cc           Specify an initial \"Cc:\" list for the entire series\n+                  of emails.\n+\n    --compose      Use \\$EDITOR to edit an introductory message for the\n                   patch series.\n \n@@ -298,7 +302,7 @@ $subject = $initial_subject;\n foreach my $t (@files) {\n \topen(F,\"<\",$t) or die \"can't open file $t\";\n \n-\t@cc = ();\n+\t@cc = @initial_cc;\n \tmy $found_mbox = 0;\n \tmy $header_done = 0;\n \t$message = \"\";\n-- \n1.2.0.g6d18\n"},{"id":"16028","messageId":"11398189241095-git-send-email-ryan@michonline.com","threadId":"3318","inReplyTo":"11398189232404-git-send-email-ryan@michonline.com","subject":"[PATCH 1/2] send-email: Add some options for controlling how addresses are automatically","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-02-13T08:22:04Z","receivedAt":"2006-02-13T08:22:04Z","isPatch":true,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"Signed-off-by: Ryan Anderson <ryan@michonline.com>\n\n---\n\n Documentation/git-send-email.txt |    7 +++++++\n git-send-email.perl              |   15 ++++++++++++---\n 2 files changed, 19 insertions(+), 3 deletions(-)\n\ndc4ad3ef1b29ce35dc0ace4d284cfab5e594bfb7\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 00537d8..c2f52f5 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -48,6 +48,9 @@ The options available are:\n \tOnly necessary if --compose is also set.  If --compose\n \tis not set, this will be prompted for.\n \n+--no-signed-off-by-cc::\n+\tDo not add emails foudn in Signed-off-by: lines to the cc list.\n+\n --quiet::\n \tMake git-send-email less verbose.  One line per email should be\n \tall that is output.\n@@ -61,6 +64,10 @@ The options available are:\n \tOnly necessary if --compose is also set.  If --compose\n \tis not set, this will be prompted for.\n \n+--suppress-from::\n+\tDo not add the From: address to the cc: list, if it shows up in a From:\n+\tline.\n+\n --to::\n \tSpecify the primary recipient of the emails generated.\n \tGenerally, this will be the upstream maintainer of the\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 3f1b3ca..abffca5 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -34,7 +34,7 @@ my $compose_filename = \".msg.$$\";\n my (@to,@cc,$initial_reply_to,$initial_subject,@files,$from,$compose);\n \n # Behavior modification variables\n-my ($chain_reply_to, $smtp_server, $quiet) = (1, \"localhost\", 0);\n+my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, \"localhost\", 0, 0, 0);\n \n # Example reply to:\n #$initial_reply_to = ''; #<20050203173208.GA23964@foobar.com>';\n@@ -52,6 +52,8 @@ my $rc = GetOptions(\"from=s\" => \\$from,\n \t\t    \"smtp-server=s\" => \\$smtp_server,\n \t\t    \"compose\" => \\$compose,\n \t\t    \"quiet\" => \\$quiet,\n+\t\t    \"suppress-from\" => \\$suppress_from,\n+\t\t    \"no-signed-off-cc\" => \\$no_signed_off_cc,\n \t );\n \n # Now, let's fill any that aren't set in with defaults:\n@@ -212,13 +214,19 @@ Options:\n                   email sent, rather than to the first email sent.\n                   Defaults to on.\n \n+   --no-signed-off-cc Suppress the automatic addition of email addresses\n+                 that appear in a Signed-off-by: line, to the cc: list.\n+\t\t Note: Using this option is not recommended.\n+\n    --smtp-server  If set, specifies the outgoing SMTP server to use.\n                   Defaults to localhost.\n \n+  --suppress-from Supress sending emails to yourself if your address\n+                  appears in a From: line.\n+\n    --quiet\tMake git-send-email less verbose.  One line per email should be\n \t\tall that is output.\n \n-\n Error: Please specify a file or a directory on the command line.\n EOT\n \texit(1);\n@@ -304,6 +312,7 @@ foreach my $t (@files) {\n \t\t\t\t\t$subject = $1;\n \n \t\t\t\t} elsif (/^(Cc|From):\\s+(.*)$/) {\n+\t\t\t\t\tnext if ($2 eq $from && $suppress_from);\n \t\t\t\t\tprintf(\"(mbox) Adding cc: %s from line '%s'\\n\",\n \t\t\t\t\t\t$2, $_) unless $quiet;\n \t\t\t\t\tpush @cc, $2;\n@@ -332,7 +341,7 @@ foreach my $t (@files) {\n \t\t\t}\n \t\t} else {\n \t\t\t$message .=  $_;\n-\t\t\tif (/^Signed-off-by: (.*)$/i) {\n+\t\t\tif (/^Signed-off-by: (.*)$/i && !$no_signed_off_cc) {\n \t\t\t\tmy $c = $1;\n \t\t\t\tchomp $c;\n \t\t\t\tpush @cc, $c;\n-- \n1.2.0.g6d18\n"}]}