{"thread":{"id":"17793","subject":"[Interdiff v3] send-email: --suppress-cc improvements","startedAt":"2009-02-14T17:06:25Z","lastAt":"2009-02-15T10:47:16Z","messageCount":4,"participants":["Thomas Rast","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"104651","messageId":"1234631186-10179-1-git-send-email-trast@student.ethz.ch","threadId":"17793","inReplyTo":"7vzlgpzfru.fsf@gitster.siamese.dyndns.org","subject":"[PATCH v3] send-email: --suppress-cc improvements","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-14T17:06:25Z","receivedAt":"2009-02-14T17:06:25Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"From: Jay Soffian <jaysoffian@gmail.com>\n\nSince 6564828 (git-send-email: Generalize auto-cc recipient\nmechanism., 2007-12-25) we can suppress automatic Cc generation\nseparately for each of the possible address sources.  However,\n--suppress-cc=sob suppressed both SOB lines and body (but not header)\nCc lines, contrary to the name.\n\nChange --suppress-cc=sob to mean only SOB lines, and add separate\nchoices 'bodycc' (body Cc lines) and 'body' (both 'sob' and 'bodycc').\nThe option --no-signed-off-by-cc now acts like --suppress-cc=sob,\nwhich is not backwards compatible but matches the name of the option.\n\nAlso update the documentation and add a few tests.\n\nSigned-off-by: Jay Soffian <jaysoffian@gmail.com>\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n Documentation/git-send-email.txt |   25 ++++--\n git-send-email.perl              |   23 ++++--\n t/t9001-send-email.sh            |  150 +++++++++++++++++++++++++++++++++-----\n 3 files changed, 163 insertions(+), 35 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex ff4aeff..45a092c 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -164,14 +164,23 @@ Automating\n \n --suppress-cc::\n \tSpecify an additional category of recipients to suppress the\n-\tauto-cc of.  'self' will avoid including the sender, 'author' will\n-\tavoid including the patch author, 'cc' will avoid including anyone\n-\tmentioned in Cc lines in the patch, 'sob' will avoid including\n-\tanyone mentioned in Signed-off-by lines, and 'cccmd' will avoid\n-\trunning the --cc-cmd.  'all' will suppress all auto cc values.\n-\tDefault is the value of 'sendemail.suppresscc' configuration value;\n-\tif that is unspecified, default to 'self' if --suppress-from is\n-\tspecified, as well as 'sob' if --no-signed-off-cc is specified.\n+\tauto-cc of:\n++\n+--\n+- 'author' will avoid including the patch author\n+- 'cc' will avoid including anyone mentioned in Cc lines in the patch header\n+- 'ccbody' will avoid including anyone mentioned in Cc lines in the\n+  patch body (commit message)\n+- 'cccmd' will avoid running the --cc-cmd.\n+- 'self' will avoid including the sender\n+- 'sob' will avoid including anyone mentioned in Signed-off-by lines\n+- 'body' is equivalent to 'sob' + 'ccbody'\n+- 'all' will suppress all auto cc values.\n+--\n++\n+Default is the value of 'sendemail.suppresscc' configuration value; if\n+that is unspecified, default to 'self' if --suppress-from is\n+specified, as well as 'body' if --no-signed-off-cc is specified.\n \n --[no-]suppress-from::\n \tIf this is set, do not add the From: address to the cc: list.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 2a3e3e8..3a8c71f 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -68,9 +68,8 @@\n   Automating:\n     --identity              <str>  * Use the sendemail.<id> options.\n     --cc-cmd                <str>  * Email Cc: via `<str> \\$patch_path`\n-    --suppress-cc           <str>  * author, self, sob, cccmd, all.\n-    --[no-]signed-off-by-cc        * Send to Cc: and Signed-off-by:\n-                                     addresses. Default on.\n+    --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, all.\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 on.\n     --[no-]thread                  * Use In-Reply-To: field. Default on.\n@@ -319,13 +318,13 @@\n if (@suppress_cc) {\n \tforeach my $entry (@suppress_cc) {\n \t\tdie \"Unknown --suppress-cc field: '$entry'\\n\"\n-\t\t\tunless $entry =~ /^(all|cccmd|cc|author|self|sob)$/;\n+\t\t\tunless $entry =~ /^(all|cccmd|cc|author|self|sob|body|bodycc)$/;\n \t\t$suppress_cc{$entry} = 1;\n \t}\n }\n \n if ($suppress_cc{'all'}) {\n-\tforeach my $entry (qw (ccmd cc author self sob)) {\n+\tforeach my $entry (qw (ccmd cc author self sob body bodycc)) {\n \t\t$suppress_cc{$entry} = 1;\n \t}\n \tdelete $suppress_cc{'all'};\n@@ -335,6 +334,13 @@\n $suppress_cc{'self'} = $suppress_from if defined $suppress_from;\n $suppress_cc{'sob'} = !$signed_off_by_cc if defined $signed_off_by_cc;\n \n+if ($suppress_cc{'body'}) {\n+\tforeach my $entry (qw (sob bodycc)) {\n+\t\t$suppress_cc{$entry} = 1;\n+\t}\n+\tdelete $suppress_cc{'body'};\n+}\n+\n # Debugging, print out the suppressions.\n if (0) {\n \tprint \"suppressions:\\n\";\n@@ -1008,13 +1014,14 @@ sub get_patch_subject($) {\n \twhile(<F>) {\n \t\t$message .=  $_;\n \t\tif (/^(Signed-off-by|Cc): (.*)$/i) {\n-\t\t\tnext if ($suppress_cc{'sob'});\n \t\t\tchomp;\n-\t\t\tmy $c = $2;\n+\t\t\tmy ($what, $c) = ($1, $2);\n \t\t\tchomp $c;\n+\t\t\tnext if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;\n+\t\t\tnext if $suppress_cc{'bodycc'} and $what =~ /Cc/i;\n \t\t\tnext if ($c eq $sender and $suppress_cc{'self'});\n \t\t\tpush @cc, $c;\n-\t\t\tprintf(\"(sob) Adding cc: %s from line '%s'\\n\",\n+\t\t\tprintf(\"(body) Adding cc: %s from line '%s'\\n\",\n \t\t\t\t$c, $_) unless $quiet;\n \t\t}\n \t}\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex da54835..ca006cf 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -32,11 +32,11 @@ clean_fake_sendmail() {\n }\n \n test_expect_success 'Extract patches' '\n-    patches=`git format-patch --cc=\"One <one@example.com>\" --cc=two@example.com -n HEAD^1`\n+    patches=`git format-patch -s --cc=\"One <one@example.com>\" --cc=two@example.com -n HEAD^1`\n '\n \n test_expect_success 'Send patches' '\n-     git send-email --from=\"Example <nobody@example.com>\" --to=nobody@example.com --smtp-server=\"$(pwd)/fake.sendmail\" $patches 2>errors\n+     git send-email --suppress-cc=sob --from=\"Example <nobody@example.com>\" --to=nobody@example.com --smtp-server=\"$(pwd)/fake.sendmail\" $patches 2>errors\n '\n \n cat >expected <<\\EOF\n@@ -74,6 +74,7 @@ EOF\n test_expect_success 'Show all headers' '\n \tgit send-email \\\n \t\t--dry-run \\\n+\t\t--suppress-cc=sob \\\n \t\t--from=\"Example <from@example.com>\" \\\n \t\t--to=to@example.com \\\n \t\t--cc=cc@example.com \\\n@@ -171,7 +172,7 @@ test_expect_success 'second message is patch' '\n \tgrep \"Subject:.*Second\" msgtxt2\n '\n \n-cat >expected-show-all-headers <<\\EOF\n+cat >expected-suppress-sob <<\\EOF\n 0001-Second.patch\n (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n@@ -191,10 +192,10 @@ X-Mailer: X-MAILER-STRING\n Result: OK\n EOF\n \n-test_expect_success 'sendemail.cc set' '\n-\tgit config sendemail.cc cc@example.com &&\n+test_suppression () {\n \tgit send-email \\\n \t\t--dry-run \\\n+\t\t--suppress-cc=$1 \\\n \t\t--from=\"Example <from@example.com>\" \\\n \t\t--to=to@example.com \\\n \t\t--smtp-server relay.example.com \\\n@@ -202,11 +203,16 @@ test_expect_success 'sendemail.cc set' '\n \tsed\t-e \"s/^\\(Date:\\).*/\\1 DATE-STRING/\" \\\n \t\t-e \"s/^\\(Message-Id:\\).*/\\1 MESSAGE-ID-STRING/\" \\\n \t\t-e \"s/^\\(X-Mailer:\\).*/\\1 X-MAILER-STRING/\" \\\n-\t\t>actual-show-all-headers &&\n-\ttest_cmp expected-show-all-headers actual-show-all-headers\n+\t\t>actual-suppress-$1 &&\n+\ttest_cmp expected-suppress-$1 actual-suppress-$1\n+}\n+\n+test_expect_success 'sendemail.cc set' '\n+\tgit config sendemail.cc cc@example.com &&\n+\ttest_suppression sob\n '\n \n-cat >expected-show-all-headers <<\\EOF\n+cat >expected-suppress-sob <<\\EOF\n 0001-Second.patch\n (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n@@ -228,17 +234,123 @@ EOF\n \n test_expect_success 'sendemail.cc unset' '\n \tgit config --unset sendemail.cc &&\n-\tgit send-email \\\n-\t\t--dry-run \\\n-\t\t--from=\"Example <from@example.com>\" \\\n-\t\t--to=to@example.com \\\n-\t\t--smtp-server relay.example.com \\\n-\t\t$patches |\n-\tsed\t-e \"s/^\\(Date:\\).*/\\1 DATE-STRING/\" \\\n-\t\t-e \"s/^\\(Message-Id:\\).*/\\1 MESSAGE-ID-STRING/\" \\\n-\t\t-e \"s/^\\(X-Mailer:\\).*/\\1 X-MAILER-STRING/\" \\\n-\t\t>actual-show-all-headers &&\n-\ttest_cmp expected-show-all-headers actual-show-all-headers\n+\ttest_suppression sob\n+'\n+\n+cat >expected-suppress-all <<\\EOF\n+0001-Second.patch\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success '--suppress-cc=all' '\n+\ttest_suppression all\n+'\n+\n+cat >expected-suppress-body <<\\EOF\n+0001-Second.patch\n+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n+(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n+(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>,<author@example.com>,<one@example.com>,<two@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Cc: A <author@example.com>, One <one@example.com>, two@example.com\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success '--suppress-cc=body' '\n+\ttest_suppression body\n+'\n+\n+cat >expected-suppress-sob <<\\EOF\n+0001-Second.patch\n+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n+(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n+(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>,<author@example.com>,<one@example.com>,<two@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Cc: A <author@example.com>, One <one@example.com>, two@example.com\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success '--suppress-cc=sob' '\n+\ttest_suppression sob\n+'\n+\n+cat >expected-suppress-bodycc <<\\EOF\n+0001-Second.patch\n+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n+(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n+(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>,<author@example.com>,<one@example.com>,<two@example.com>,<committer@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Cc: A <author@example.com>, One <one@example.com>, two@example.com, C O Mitter <committer@example.com>\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success '--suppress-cc=bodycc' '\n+\ttest_suppression bodycc\n+'\n+\n+cat >expected-suppress-cc <<\\EOF\n+0001-Second.patch\n+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n+(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>,<author@example.com>,<committer@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Cc: A <author@example.com>, C O Mitter <committer@example.com>\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success '--suppress-cc=cc' '\n+\ttest_suppression cc\n '\n \n test_expect_success '--compose adds MIME for utf8 body' '\n-- \n1.6.2.rc0.287.g66074\n"},{"id":"104649","messageId":"1234631186-10179-2-git-send-email-trast@student.ethz.ch","threadId":"17793","inReplyTo":"1234631186-10179-1-git-send-email-trast@student.ethz.ch","subject":"[Interdiff v3] send-email: --suppress-cc improvements","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-14T17:06:26Z","receivedAt":"2009-02-14T17:06:26Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Interdiff to Jay's v2.\n---\n Documentation/git-send-email.txt |   27 +++++---\n git-send-email.perl              |   20 +++---\n t/t9001-send-email.sh            |  142 +++++++++++++++++++++++++++++---------\n 3 files changed, 136 insertions(+), 53 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex d6af035..45a092c 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -164,16 +164,23 @@ Automating\n \n --suppress-cc::\n \tSpecify an additional category of recipients to suppress the\n-\tauto-cc of.  'self' will avoid including the sender, 'author' will\n-\tavoid including the patch author, 'cc' will avoid including anyone\n-\tmentioned in Cc lines in the patch header, 'ccbody' will avoid\n-\tincluding anyone mentioned in Cc lines in the patch body (commit\n-\tmessage), 'sob' will avoid including anyone mentioned in Signed-off-by\n-\tlines, and 'cccmd' will avoid running the --cc-cmd. 'body' is\n-\tequivalent to 'sob' + 'ccbody'. 'all' will suppress all auto cc\n-\tvalues.  Default is the value of 'sendemail.suppresscc' configuration\n-\tvalue; if that is unspecified, default to 'self' if --suppress-from is\n-\tspecified, as well as 'body' if --no-signed-off-cc is specified.\n+\tauto-cc of:\n++\n+--\n+- 'author' will avoid including the patch author\n+- 'cc' will avoid including anyone mentioned in Cc lines in the patch header\n+- 'ccbody' will avoid including anyone mentioned in Cc lines in the\n+  patch body (commit message)\n+- 'cccmd' will avoid running the --cc-cmd.\n+- 'self' will avoid including the sender\n+- 'sob' will avoid including anyone mentioned in Signed-off-by lines\n+- 'body' is equivalent to 'sob' + 'ccbody'\n+- 'all' will suppress all auto cc values.\n+--\n++\n+Default is the value of 'sendemail.suppresscc' configuration value; if\n+that is unspecified, default to 'self' if --suppress-from is\n+specified, as well as 'body' if --no-signed-off-cc is specified.\n \n --[no-]suppress-from::\n \tIf this is set, do not add the From: address to the cc: list.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 23a55e2..3a8c71f 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -69,8 +69,7 @@\n     --identity              <str>  * Use the sendemail.<id> options.\n     --cc-cmd                <str>  * Email Cc: via `<str> \\$patch_path`\n     --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, all.\n-    --[no-]signed-off-by-cc        * Send to Cc: and Signed-off-by:\n-                                     addresses. 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 on.\n     --[no-]thread                  * Use In-Reply-To: field. Default on.\n@@ -331,16 +330,16 @@\n \tdelete $suppress_cc{'all'};\n }\n \n-if ($suppress_cc{'sob'} && $suppress_cc{'bodycc'}) {\n-\t$suppress_cc{'body'} = 1;\n-}\n-\n # If explicit old-style ones are specified, they trump --suppress-cc.\n $suppress_cc{'self'} = $suppress_from if defined $suppress_from;\n-# For backwards compatibility, old-style --signed-off-by-cc suppresses\n-# SOB and body Cc lines, whereas --supress-cc=sob suppresses just the SOB\n-# line, but not the body Cc.\n-$suppress_cc{'body'} = !$signed_off_by_cc if defined $signed_off_by_cc;\n+$suppress_cc{'sob'} = !$signed_off_by_cc if defined $signed_off_by_cc;\n+\n+if ($suppress_cc{'body'}) {\n+\tforeach my $entry (qw (sob bodycc)) {\n+\t\t$suppress_cc{$entry} = 1;\n+\t}\n+\tdelete $suppress_cc{'body'};\n+}\n \n # Debugging, print out the suppressions.\n if (0) {\n@@ -1014,7 +1013,6 @@ sub get_patch_subject($) {\n \t# Now parse the message body\n \twhile(<F>) {\n \t\t$message .=  $_;\n-\t\tnext if $suppress_cc{'body'};\n \t\tif (/^(Signed-off-by|Cc): (.*)$/i) {\n \t\t\tchomp;\n \t\t\tmy ($what, $c) = ($1, $2);\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex d7766f9..ca006cf 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -172,7 +172,7 @@ test_expect_success 'second message is patch' '\n \tgrep \"Subject:.*Second\" msgtxt2\n '\n \n-cat >expected-show-all-headers <<\\EOF\n+cat >expected-suppress-sob <<\\EOF\n 0001-Second.patch\n (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n@@ -192,11 +192,10 @@ X-Mailer: X-MAILER-STRING\n Result: OK\n EOF\n \n-test_expect_success 'sendemail.cc set' '\n-\tgit config sendemail.cc cc@example.com &&\n+test_suppression () {\n \tgit send-email \\\n \t\t--dry-run \\\n-\t\t--suppress-cc=sob \\\n+\t\t--suppress-cc=$1 \\\n \t\t--from=\"Example <from@example.com>\" \\\n \t\t--to=to@example.com \\\n \t\t--smtp-server relay.example.com \\\n@@ -204,11 +203,16 @@ test_expect_success 'sendemail.cc set' '\n \tsed\t-e \"s/^\\(Date:\\).*/\\1 DATE-STRING/\" \\\n \t\t-e \"s/^\\(Message-Id:\\).*/\\1 MESSAGE-ID-STRING/\" \\\n \t\t-e \"s/^\\(X-Mailer:\\).*/\\1 X-MAILER-STRING/\" \\\n-\t\t>actual-show-all-headers &&\n-\ttest_cmp expected-show-all-headers actual-show-all-headers\n+\t\t>actual-suppress-$1 &&\n+\ttest_cmp expected-suppress-$1 actual-suppress-$1\n+}\n+\n+test_expect_success 'sendemail.cc set' '\n+\tgit config sendemail.cc cc@example.com &&\n+\ttest_suppression sob\n '\n \n-cat >expected-show-all-headers <<\\EOF\n+cat >expected-suppress-sob <<\\EOF\n 0001-Second.patch\n (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n (mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n@@ -230,21 +234,10 @@ EOF\n \n test_expect_success 'sendemail.cc unset' '\n \tgit config --unset sendemail.cc &&\n-\tgit send-email \\\n-\t\t--dry-run \\\n-\t\t--suppress-cc=sob \\\n-\t\t--from=\"Example <from@example.com>\" \\\n-\t\t--to=to@example.com \\\n-\t\t--smtp-server relay.example.com \\\n-\t\t$patches |\n-\tsed\t-e \"s/^\\(Date:\\).*/\\1 DATE-STRING/\" \\\n-\t\t-e \"s/^\\(Message-Id:\\).*/\\1 MESSAGE-ID-STRING/\" \\\n-\t\t-e \"s/^\\(X-Mailer:\\).*/\\1 X-MAILER-STRING/\" \\\n-\t\t>actual-show-all-headers &&\n-\ttest_cmp expected-show-all-headers actual-show-all-headers\n+\ttest_suppression sob\n '\n \n-cat >expected-show-all-headers <<\\EOF\n+cat >expected-suppress-all <<\\EOF\n 0001-Second.patch\n Dry-OK. Log says:\n Server: relay.example.com\n@@ -261,18 +254,103 @@ Result: OK\n EOF\n \n test_expect_success '--suppress-cc=all' '\n-\tgit send-email \\\n-\t\t--dry-run \\\n-\t\t--suppress-cc=all \\\n-\t\t--from=\"Example <from@example.com>\" \\\n-\t\t--to=to@example.com \\\n-\t\t--smtp-server relay.example.com \\\n-\t\t$patches |\n-\tsed\t-e \"s/^\\(Date:\\).*/\\1 DATE-STRING/\" \\\n-\t\t-e \"s/^\\(Message-Id:\\).*/\\1 MESSAGE-ID-STRING/\" \\\n-\t\t-e \"s/^\\(X-Mailer:\\).*/\\1 X-MAILER-STRING/\" \\\n-\t\t>actual-show-all-headers &&\n-\ttest_cmp expected-show-all-headers actual-show-all-headers\n+\ttest_suppression all\n+'\n+\n+cat >expected-suppress-body <<\\EOF\n+0001-Second.patch\n+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n+(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n+(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>,<author@example.com>,<one@example.com>,<two@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Cc: A <author@example.com>, One <one@example.com>, two@example.com\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success '--suppress-cc=body' '\n+\ttest_suppression body\n+'\n+\n+cat >expected-suppress-sob <<\\EOF\n+0001-Second.patch\n+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n+(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n+(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>,<author@example.com>,<one@example.com>,<two@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Cc: A <author@example.com>, One <one@example.com>, two@example.com\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success '--suppress-cc=sob' '\n+\ttest_suppression sob\n+'\n+\n+cat >expected-suppress-bodycc <<\\EOF\n+0001-Second.patch\n+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n+(mbox) Adding cc: One <one@example.com> from line 'Cc: One <one@example.com>, two@example.com'\n+(mbox) Adding cc: two@example.com from line 'Cc: One <one@example.com>, two@example.com'\n+(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>,<author@example.com>,<one@example.com>,<two@example.com>,<committer@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Cc: A <author@example.com>, One <one@example.com>, two@example.com, C O Mitter <committer@example.com>\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success '--suppress-cc=bodycc' '\n+\ttest_suppression bodycc\n+'\n+\n+cat >expected-suppress-cc <<\\EOF\n+0001-Second.patch\n+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'\n+(body) Adding cc: C O Mitter <committer@example.com> from line 'Signed-off-by: C O Mitter <committer@example.com>'\n+Dry-OK. Log says:\n+Server: relay.example.com\n+MAIL FROM:<from@example.com>\n+RCPT TO:<to@example.com>,<author@example.com>,<committer@example.com>\n+From: Example <from@example.com>\n+To: to@example.com\n+Cc: A <author@example.com>, C O Mitter <committer@example.com>\n+Subject: [PATCH 1/1] Second.\n+Date: DATE-STRING\n+Message-Id: MESSAGE-ID-STRING\n+X-Mailer: X-MAILER-STRING\n+\n+Result: OK\n+EOF\n+\n+test_expect_success '--suppress-cc=cc' '\n+\ttest_suppression cc\n '\n \n test_expect_success '--compose adds MIME for utf8 body' '\n-- \n1.6.2.rc0.287.g66074\n"},{"id":"104707","messageId":"200902142321.22904.trast@student.ethz.ch","threadId":"17793","inReplyTo":"1234631186-10179-1-git-send-email-trast@student.ethz.ch","subject":"Re: [PATCH v3] send-email: --suppress-cc improvements","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-14T22:21:11Z","receivedAt":"2009-02-14T22:21:11Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"I just noticed that I lost the comments after '---' due to repeated\nformat-patch'ing, so here goes:\n\nThomas Rast wrote:\n> From: Jay Soffian <jaysoffian@gmail.com>\n> \n> Since 6564828 (git-send-email: Generalize auto-cc recipient\n> mechanism., 2007-12-25) we can suppress automatic Cc generation\n> separately for each of the possible address sources.  However,\n> --suppress-cc=sob suppressed both SOB lines and body (but not header)\n> Cc lines, contrary to the name.\n> \n> Change --suppress-cc=sob to mean only SOB lines, and add separate\n> choices 'bodycc' (body Cc lines) and 'body' (both 'sob' and 'bodycc').\n> The option --no-signed-off-by-cc now acts like --suppress-cc=sob,\n> which is not backwards compatible but matches the name of the option.\n> \n> Also update the documentation and add a few tests.\n> \n> Signed-off-by: Jay Soffian <jaysoffian@gmail.com>\n> Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n> ---\n\nI tried to address Junio's comments, mostly by reformatting the docs\nand expanding the tests, but also changing the handling of 'body' in\nthe code.  I also edited the patch message to my liking.\n\nOf course your SOB above is now forged, so you'll have to ack it.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"104758","messageId":"7vprhkm0y3.fsf@gitster.siamese.dyndns.org","threadId":"17793","inReplyTo":"200902142321.22904.trast@student.ethz.ch","subject":"Re: [PATCH v3] send-email: --suppress-cc improvements","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-15T10:47:16Z","receivedAt":"2009-02-15T10:47:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\n> I just noticed that I lost the comments after '---' due to repeated\n> format-patch'ing, so here goes:\n\nThanks; Jay did another round of updates based on this one, which\nI think is the one I took, if I did things correctly ;-)\n"}]}