{"thread":{"id":"11378","subject":"[PATCH] git-send-email: Add --suppress-all-from option.","startedAt":"2007-12-21T06:01:00Z","lastAt":"2007-12-26T05:32:21Z","messageCount":17,"participants":["David Brown","Joel Becker","Brian Swetland","Junio C Hamano","Theodore Tso","Sean"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"63903","messageId":"1198216860-487-1-git-send-email-git@davidb.org","threadId":"11378","inReplyTo":null,"subject":"[PATCH] git-send-email: Add --suppress-all-from option.","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2007-12-21T06:01:00Z","receivedAt":"2007-12-21T06:01:00Z","isPatch":true,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"Sometimes, it is useful to be able to send a patch to a third party\nwithout the author of the patch being copied on the message.  An\ncommon example would be an internal discussion at a company to ask if\na particular patch should be applied.  Some environments may even have\npolicy against such mail being sent outside of the company.\n\nAdd the --suppress-all-from/--no-suppress-all-from options to avoid\nsending patches to the patch author, even if different from the\nsender.  Add the sendemail.suppressallfrom config option to allow this\nto have a different default.\n\nSigned-off-by: David Brown <git@davidb.org>\n---\n Documentation/git-send-email.txt |    7 +++++++\n git-send-email.perl              |    9 ++++++++-\n 2 files changed, 15 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex f0bd285..5d06264 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -117,6 +117,13 @@ The --cc option must be repeated for each user you want on the cc list.\n         Default is the value of 'sendemail.suppressfrom' configuration value;\n         if that is unspecified, default to --no-suppress-from.\n \n+--suppress-all-from, --no-suppress-all-from::\n+        If this is set, do not add the From: address to the cc: list,\n+        even if it is different than the person sending the email.\n+        Default is the value of the 'sendemail.suppressallfrom'\n+        configuration value; if that is unspecified, default to\n+        -no-suppress-all-from.\n+\n --thread, --no-thread::\n \tIf this is set, the In-Reply-To header will be set on each email sent.\n \tIf disabled with \"--no-thread\", no emails will have the In-Reply-To\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 248d035..80265b5 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -90,6 +90,9 @@ Options:\n \n    --suppress-from Suppress sending emails to yourself. Defaults to off.\n \n+   --suppress-all-from Never automatically send to a patch author.\n+                  Defaults to off.\n+\n    --thread       Specify that the \"In-Reply-To:\" header should be set on all\n                   emails. Defaults to on.\n \n@@ -174,7 +177,8 @@ if ($@) {\n my ($quiet, $dry_run) = (0, 0);\n \n # Variables with corresponding config settings\n-my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);\n+my ($thread, $chain_reply_to, $suppress_from, $suppress_all_from);\n+my ($signed_off_cc, $cc_cmd);\n my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_authpass, $smtp_ssl);\n my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);\n \n@@ -182,6 +186,7 @@ my %config_bool_settings = (\n     \"thread\" => [\\$thread, 1],\n     \"chainreplyto\" => [\\$chain_reply_to, 1],\n     \"suppressfrom\" => [\\$suppress_from, 0],\n+    \"suppressallfrom\" => [\\$suppress_all_from, 0],\n     \"signedoffcc\" => [\\$signed_off_cc, 1],\n     \"smtpssl\" => [\\$smtp_ssl, 0],\n );\n@@ -218,6 +223,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"quiet\" => \\$quiet,\n \t\t    \"cc-cmd=s\" => \\$cc_cmd,\n \t\t    \"suppress-from!\" => \\$suppress_from,\n+\t\t    \"suppress-all-from!\" => \\$suppress_all_from,\n \t\t    \"signed-off-cc|signed-off-by-cc!\" => \\$signed_off_cc,\n \t\t    \"dry-run\" => \\$dry_run,\n \t\t    \"envelope-sender=s\" => \\$envelope_sender,\n@@ -700,6 +706,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 ($suppress_all_from);\n \t\t\t\t\tif (unquote_rfc2047($2) eq $sender) {\n \t\t\t\t\t\tnext if ($suppress_from);\n \t\t\t\t\t}\n-- \n1.5.3.7\n"},{"id":"63917","messageId":"20071221110532.GG18627@ca-server1.us.oracle.com","threadId":"11378","inReplyTo":"1198216860-487-1-git-send-email-git@davidb.org","subject":"Re: [PATCH] git-send-email: Add --suppress-all-from option.","fromName":"Joel Becker","fromEmail":"joel.becker@oracle.com","sentAt":"2007-12-21T11:05:32Z","receivedAt":"2007-12-21T11:05:32Z","isPatch":true,"sender":{"key":"joel.becker@oracle.com","avatar":null},"body":"On Thu, Dec 20, 2007 at 10:01:00PM -0800, David Brown wrote:\n> Sometimes, it is useful to be able to send a patch to a third party\ns/Sometimes/Most of the time/g\n\n> without the author of the patch being copied on the message.  An\n> common example would be an internal discussion at a company to ask if\n> a particular patch should be applied.  Some environments may even have\n> policy against such mail being sent outside of the company.\n> \n> Add the --suppress-all-from/--no-suppress-all-from options to avoid\n> sending patches to the patch author, even if different from the\n> sender.  Add the sendemail.suppressallfrom config option to allow this\n> to have a different default.\n> \n> Signed-off-by: David Brown <git@davidb.org>\nPlease-dog-yes: Joel Becker <jlbec@evilplan.org>\n\n> ---\n>  Documentation/git-send-email.txt |    7 +++++++\n>  git-send-email.perl              |    9 ++++++++-\n>  2 files changed, 15 insertions(+), 1 deletions(-)\n> \n> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n> index f0bd285..5d06264 100644\n> --- a/Documentation/git-send-email.txt\n> +++ b/Documentation/git-send-email.txt\n> @@ -117,6 +117,13 @@ The --cc option must be repeated for each user you want on the cc list.\n>          Default is the value of 'sendemail.suppressfrom' configuration value;\n>          if that is unspecified, default to --no-suppress-from.\n>  \n> +--suppress-all-from, --no-suppress-all-from::\n> +        If this is set, do not add the From: address to the cc: list,\n> +        even if it is different than the person sending the email.\n> +        Default is the value of the 'sendemail.suppressallfrom'\n> +        configuration value; if that is unspecified, default to\n> +        -no-suppress-all-from.\n> +\n>  --thread, --no-thread::\n>  \tIf this is set, the In-Reply-To header will be set on each email sent.\n>  \tIf disabled with \"--no-thread\", no emails will have the In-Reply-To\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 248d035..80265b5 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -90,6 +90,9 @@ Options:\n>  \n>     --suppress-from Suppress sending emails to yourself. Defaults to off.\n>  \n> +   --suppress-all-from Never automatically send to a patch author.\n> +                  Defaults to off.\n> +\n>     --thread       Specify that the \"In-Reply-To:\" header should be set on all\n>                    emails. Defaults to on.\n>  \n> @@ -174,7 +177,8 @@ if ($@) {\n>  my ($quiet, $dry_run) = (0, 0);\n>  \n>  # Variables with corresponding config settings\n> -my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);\n> +my ($thread, $chain_reply_to, $suppress_from, $suppress_all_from);\n> +my ($signed_off_cc, $cc_cmd);\n>  my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_authpass, $smtp_ssl);\n>  my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);\n>  \n> @@ -182,6 +186,7 @@ my %config_bool_settings = (\n>      \"thread\" => [\\$thread, 1],\n>      \"chainreplyto\" => [\\$chain_reply_to, 1],\n>      \"suppressfrom\" => [\\$suppress_from, 0],\n> +    \"suppressallfrom\" => [\\$suppress_all_from, 0],\n>      \"signedoffcc\" => [\\$signed_off_cc, 1],\n>      \"smtpssl\" => [\\$smtp_ssl, 0],\n>  );\n> @@ -218,6 +223,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n>  \t\t    \"quiet\" => \\$quiet,\n>  \t\t    \"cc-cmd=s\" => \\$cc_cmd,\n>  \t\t    \"suppress-from!\" => \\$suppress_from,\n> +\t\t    \"suppress-all-from!\" => \\$suppress_all_from,\n>  \t\t    \"signed-off-cc|signed-off-by-cc!\" => \\$signed_off_cc,\n>  \t\t    \"dry-run\" => \\$dry_run,\n>  \t\t    \"envelope-sender=s\" => \\$envelope_sender,\n> @@ -700,6 +706,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 ($suppress_all_from);\n>  \t\t\t\t\tif (unquote_rfc2047($2) eq $sender) {\n>  \t\t\t\t\t\tnext if ($suppress_from);\n>  \t\t\t\t\t}\n> -- \n> 1.5.3.7\n> \n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n-- \n\nLife's Little Instruction Book #456\n\n\t\"Send your loved one flowers.  Think of a reason later.\"\n\nJoel Becker\nPrincipal Software Developer\nOracle\nE-mail: joel.becker@oracle.com\nPhone: (650) 506-8127\n"},{"id":"63920","messageId":"20071221111412.GA8695@bulgaria.corp.google.com","threadId":"11378","inReplyTo":"1198216860-487-1-git-send-email-git@davidb.org","subject":"Re: [PATCH] git-send-email: Add --suppress-all-from option.","fromName":"Brian Swetland","fromEmail":"swetland@google.com","sentAt":"2007-12-21T11:14:12Z","receivedAt":"2007-12-21T11:14:12Z","isPatch":true,"sender":{"key":"swetland@google.com","avatar":"https://gravatar.com/avatar/b26b7c772097c55d8febb0fc027dd2ef577a05994a321819f49ab3c9153ac8b1?d=mp&s=160"},"body":"[David Brown <git@davidb.org>]\n> Sometimes, it is useful to be able to send a patch to a third party\n> without the author of the patch being copied on the message.  An\n> common example would be an internal discussion at a company to ask if\n> a particular patch should be applied.  Some environments may even have\n> policy against such mail being sent outside of the company.\n> \n> Add the --suppress-all-from/--no-suppress-all-from options to avoid\n> sending patches to the patch author, even if different from the\n> sender.  Add the sendemail.suppressallfrom config option to allow this\n> to have a different default.\n> \n> Signed-off-by: David Brown <git@davidb.org>\n\nYes-Please: Brian Swetland <swetland@google.com>\n\nThis has caused me some pain previously, and just earlier today I \nreceived an internal patch mail from somebody at another company who\nalmost certainly did not intend to cc me.\n\nBrian\n"},{"id":"63938","messageId":"7vfxxw7xkb.fsf@gitster.siamese.dyndns.org","threadId":"11378","inReplyTo":"1198216860-487-1-git-send-email-git@davidb.org","subject":"Re: [PATCH] git-send-email: Add --suppress-all-from option.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-21T17:43:48Z","receivedAt":"2007-12-21T17:43:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Brown <git@davidb.org> writes:\n\n> Sometimes, it is useful to be able to send a patch to a third party\n> without the author of the patch being copied on the message.\n\nI would agree with the cause, but not necessarily with the\nexecution.\n\n> +--suppress-all-from, --no-suppress-all-from::\n> +        If this is set, do not add the From: address to the cc: list,\n> +        even if it is different than the person sending the email.\n> +        Default is the value of the 'sendemail.suppressallfrom'\n> +        configuration value; if that is unspecified, default to\n> +        -no-suppress-all-from.\n\nThe option name feels as if it is somehow affecting From: but\nthis is all about recipients.  It needs to be named better.\n\nEven more importantly, git-send-email has too many places that\npick up additional recipients.  I doubt --suppress-foo to\nsuppress one such source \"foo\" is sustainable.  We should try to\nclean up the mess, not adding to it.\n\nSo let's analyze the current situation first.  It seems that we\ncurrently pick up the list of recipients from the following\nplaces:\n\n * obviously, --to command line;\n * mbox Cc: header lines;\n * mbox From: header lines;\n * lots-of-email first line\n * $cc_cmd output;\n * Signed-off-by: lines in body;\n * Cc: lines in body;\n\nThe --no-signed-off-cc option is about omitting the last two\nfrom the recipients.  We do not have a way to squelch other\nsources of extra recipients, hence the need for your patch.\n\nThe --suppress-from option is about not giving an extra copy to\nthe sender.  It is \"suppress from-address from the recipient\nlist\", so the option name makes sense.\n\nYour --suppress-all-from, from a cursory read of your patch,\nomits only mbox Cc: and From: line recipients -- it is far from\n\"all\", isn't it?  --signed-off-cc defaults to true so you would\nneed to suppress that at least to call it \"all\".\n\nA cleaner approach might be:\n\n - introduce a helper function add_to_recipients that take \\@cc,\n   $recipient and the \"source class\".  Make this function\n   responsible for not adding the sender to the list\n   (i.e. --suppress-from, which is currently checked\n   everywhere), and for not adding recipients from specified\n   classes of sources, like this:\n\n        sub add_to_recipients {\n                my ($cc, $source, $recipient) = @_;\n                return 0 if ($suppress_from and $sender eq $recipient);\n                return 0 if ($suppressed_recipient_source{$source});\n                push @$cc, $recipient;\n                return 1;\n        }\n\n   Instead of returning 1 unconditionally, it might make sense\n   to omit pushing duplicate here and to return 0 when\n   $recipient was already in @$cc.\n\n - adjust the places where \"push @cc\" happens to use the above\n   helper; the existing suppress logic in the callers can and\n   should be removed as the add_to_recipients will be\n   responsible for it, like this (an example for cc-cmd part):\n\n        if (defined $cc_cmd) {\n        open(F, \"$cc_cmd $t |\")\n                or die \"(cc-cmd) Could not execute '$cc_cmd'\";\n        while(<F>) {\n                my $c = $_;\n                $c =~ s/^\\s*//g;\n                $c =~ s/\\n$//g;\n-               next if ($c eq $sender and $suppress_from);\n-               push @cc, $c;\n+               next if (!add_to_recipients(\\@cc, 'cccmd', $c));\n                printf(\"(cc-cmd) Adding cc: %s from: '%s'\\n\",\n                        $c, $cc_cmd) unless $quiet;\n        }\n\n - define a global %suppressed_recipient_source hash to be used\n   in add_to_recipients().  The existing --no-signed-off-cc is\n   about adding two sources to this hash.\n\n - make the %suppressed_recipient_source configurable from the\n   command line and repository configuration.\n\nAs to the \"recipient source\" classes, I think they can be\ncategorized as:\n\n * 'cc', to cover mbox Cc: header, lots-of-email first line, and\n    Cc: lines in body;\n\n * 'sob', to cover Signed-off-by: lines in body;\n\n * 'cccmd', to cover $cc_cmd output;\n\nHmm?\n"},{"id":"63944","messageId":"20071221192120.GA13171@mail.oracle.com","threadId":"11378","inReplyTo":"7vfxxw7xkb.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-send-email: Add --suppress-all-from option.","fromName":"Joel Becker","fromEmail":"joel.becker@oracle.com","sentAt":"2007-12-21T19:21:20Z","receivedAt":"2007-12-21T19:21:20Z","isPatch":true,"sender":{"key":"joel.becker@oracle.com","avatar":null},"body":"On Fri, Dec 21, 2007 at 09:43:48AM -0800, Junio C Hamano wrote:\n> The option name feels as if it is somehow affecting From: but\n> this is all about recipients.  It needs to be named better.\n> \n> Even more importantly, git-send-email has too many places that\n> pick up additional recipients.  I doubt --suppress-foo to\n> suppress one such source \"foo\" is sustainable.  We should try to\n> clean up the mess, not adding to it.\n\n\tYay, even better that we're going to evaluate the sucker (I was\njust complaining about this yesterday to someone, so how apropos that it\ncomes up on-list).\n\tFirst and foremost, I think git-send-email should not default to\nanything.  It was quite a surprise, the first time I tried to use it, to\ndiscover I had to add two options to ~/.gitconfig just for sane\nbehavior.  Never mind that I couldn't suppress the author-cc.  I think\nthat a naive \"git send-email --to bob@bob.com foo.patch\" should only go\nto bob, period.\n\tWe can then add ways to auto-cc.  I don't mind typing the extra\nbits.  Heck, we could even define a --review that does what is currently\nthe default - cc-everyone-who-might-care-as-we-go-upstream.\n\nJoel\n\n-- \n\nLife's Little Instruction Book #99\n\n\t\"Think big thoughts, but relish small pleasures.\"\n\nJoel Becker\nPrincipal Software Developer\nOracle\nE-mail: joel.becker@oracle.com\nPhone: (650) 506-8127\n"},{"id":"63962","messageId":"20071221223748.GA499@old.davidb.org","threadId":"11378","inReplyTo":"7vfxxw7xkb.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-send-email: Add --suppress-all-from option.","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2007-12-21T22:37:48Z","receivedAt":"2007-12-21T22:37:48Z","isPatch":true,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"On Fri, Dec 21, 2007 at 09:43:48AM -0800, Junio C Hamano wrote:\n>David Brown <git@davidb.org> writes:\n>\n>> Sometimes, it is useful to be able to send a patch to a third party\n>> without the author of the patch being copied on the message.\n>\n>I would agree with the cause, but not necessarily with the\n>execution.\n\nOk.  I will look into the overall cleanup, but probably not until this\nweekend.\n\nDave\n"},{"id":"63974","messageId":"20071222005504.GD8601@thunk.org","threadId":"11378","inReplyTo":"20071221192120.GA13171@mail.oracle.com","subject":"Re: [PATCH] git-send-email: Add --suppress-all-from option.","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-12-22T00:55:04Z","receivedAt":"2007-12-22T00:55:04Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Fri, Dec 21, 2007 at 11:21:20AM -0800, Joel Becker wrote:\n> \tYay, even better that we're going to evaluate the sucker (I was\n> just complaining about this yesterday to someone, so how apropos that it\n> comes up on-list).\n> \tFirst and foremost, I think git-send-email should not default to\n> anything.  It was quite a surprise, the first time I tried to use it, to\n> discover I had to add two options to ~/.gitconfig just for sane\n> behavior.  Never mind that I couldn't suppress the author-cc.  I think\n> that a naive \"git send-email --to bob@bob.com foo.patch\" should only go\n> to bob, period.\n> \tWe can then add ways to auto-cc.  I don't mind typing the extra\n> bits.  Heck, we could even define a --review that does what is currently\n> the default - cc-everyone-who-might-care-as-we-go-upstream.\n\nWhere e-mail addresses are used by default by git-send-email should\nprobably be a git configuration option (and then we will need to\ndocument the heck out of this when we change it, so this is probably a\ngit-1.6.0 thing), so projects can tell all of their contributors if\nthey need to make changes in their config file for the proper\ndefaults.  Right now the defaults are more or less perfect for the\nLinux Kernel development processes, but other folks might not like\nthem.  On the flip side, just removing all of the current auto-cc's\nwould be awfully inconvenient for the Linux kernel development\ncommunity.\n\n\t\t\t\t\t\t- Ted\n"},{"id":"64080","messageId":"1198522902-12117-1-git-send-email-git@davidb.org","threadId":"11378","inReplyTo":"1198216860-487-1-git-send-email-git@davidb.org","subject":"[PATCH] git-send-email: Generalize auto-cc recipient mechanism.","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2007-12-24T19:01:42Z","receivedAt":"2007-12-24T19:01:42Z","isPatch":true,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"There are a few options to git-send-email to suppress the automatic\ngeneration of 'Cc' fields: --suppress-from, and --signed-off-cc.  However,\nthere are other times that git-send-email automatically includes Cc'd\nrecipients.  This is not desirable for all development environments.\n\nAdd a new option --suppress-cc, which can be specified one or more times to\nlist the categories of auto-cc fields that should be suppressed.  If not\nspecified, it defaults to values to give the same behavior as specified\nby --suppress-from, and --signed-off-cc.  The categories are:\n\n  self   - patch sender.  Same as --suppress-from.\n  author - patch author.\n  cc     - cc lines mentioned in the patch.\n  cccmd  - avoid running the cccmd.\n  sob    - signed off by lines.\n\nSigned-off-by: David Brown <git@davidb.org>\n---\nI tried to generalize as suggested in Junio's email, but it just didn't fit\nwell with the decision tree in the code.\n\nWhat bothers me most about this change is that --signed-of-cc\nand --suppress-from are silently ignored if --suppress-cc is given, either\non the command line, or in the config.\n\n Documentation/git-send-email.txt |   13 +++++++++++++\n git-send-email.perl              |   34 ++++++++++++++++++++++++++++++----\n 2 files changed, 43 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex f0bd285..432f336 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -70,6 +70,7 @@ The --cc option must be repeated for each user you want on the cc list.\n         cc list.\n         Default is the value of 'sendemail.signedoffcc' configuration value;\n         if that is unspecified, default to --signed-off-by-cc.\n+        Note that this has no effect if --suppress-cc is given.\n \n --quiet::\n \tMake git-send-email less verbose.  One line per email should be\n@@ -116,6 +117,18 @@ The --cc option must be repeated for each user you want on the cc list.\n         If this is set, do not add the From: address to the cc: list.\n         Default is the value of 'sendemail.suppressfrom' configuration value;\n         if that is unspecified, default to --no-suppress-from.\n+        Note that this has no effect if --suppress-cc is given.\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.\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 \n --thread, --no-thread::\n \tIf this is set, the In-Reply-To header will be set on each email sent.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e47994a..cb9adf2 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -88,6 +88,11 @@ Options:\n \n    --smtp-ssl     If set, connects to the SMTP server using SSL.\n \n+   --suppress-cc  Suppress the specified category of auto-CC.  The category\n+                  can be one of 'author' for the patch author, 'self' to\n+                  avoid copying yourself, 'sob' for Signed-off-by lines,\n+                  and 'cccmd' for the output of the cccmd.\n+\n    --suppress-from Suppress sending emails to yourself. Defaults to off.\n \n    --thread       Specify that the \"In-Reply-To:\" header should be set on all\n@@ -177,6 +182,7 @@ my ($quiet, $dry_run) = (0, 0);\n my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);\n my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_authpass, $smtp_ssl);\n my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);\n+my (@suppress_cc);\n \n my %config_bool_settings = (\n     \"thread\" => [\\$thread, 1],\n@@ -196,6 +202,7 @@ my %config_settings = (\n     \"aliasfiletype\" => \\$aliasfiletype,\n     \"bcc\" => \\@bcclist,\n     \"aliasesfile\" => \\@alias_files,\n+    \"suppresscc\" => \\@suppress_cc,\n );\n \n # Begin by accumulating all the variables (defined above), that we will end up\n@@ -218,6 +225,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"quiet\" => \\$quiet,\n \t\t    \"cc-cmd=s\" => \\$cc_cmd,\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_cc,\n \t\t    \"dry-run\" => \\$dry_run,\n \t\t    \"envelope-sender=s\" => \\$envelope_sender,\n@@ -262,6 +270,20 @@ foreach my $setting (values %config_bool_settings) {\n \t${$setting->[0]} = $setting->[1] unless (defined (${$setting->[0]}));\n }\n \n+# Set CC suppressions\n+my(%suppress_cc);\n+if (@suppress_cc) {\n+\tforeach my $entry (@suppress_cc) {\n+\t\tdie \"Unknown --suppress-cc field: '$entry'\\n\"\n+\t\t\tunless $entry =~ /^(cccmd|cc|author|self|sob)$/;\n+\t\t$suppress_cc{$entry} = 1;\n+\t}\n+} else {\n+\t# Convert the old-style options.\n+\t$suppress_cc{'self'} = 1 if $suppress_from;\n+\t$suppress_cc{'sob'} = 1 unless $signed_off_cc;\n+}\n+\n my ($repoauthor) = $repo->ident_person('author');\n my ($repocommitter) = $repo->ident_person('committer');\n \n@@ -701,11 +723,14 @@ foreach my $t (@files) {\n \n \t\t\t\t} elsif (/^(Cc|From):\\s+(.*)$/) {\n \t\t\t\t\tif (unquote_rfc2047($2) eq $sender) {\n-\t\t\t\t\t\tnext if ($suppress_from);\n+\t\t\t\t\t\tnext if ($suppress_cc{'self'});\n \t\t\t\t\t}\n \t\t\t\t\telsif ($1 eq 'From') {\n \t\t\t\t\t\t($author, $author_encoding)\n \t\t\t\t\t\t  = unquote_rfc2047($2);\n+\t\t\t\t\t\tnext if ($suppress_cc{'author'});\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\tnext if ($suppress_cc{'cc'});\n \t\t\t\t\t}\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@@ -732,7 +757,7 @@ foreach my $t (@files) {\n \t\t\t\t# line 2 = subject\n \t\t\t\t# So let's support that, too.\n \t\t\t\t$input_format = 'lots';\n-\t\t\t\tif (@cc == 0) {\n+\t\t\t\tif (@cc == 0 && !$suppress_cc{'cc'}) {\n \t\t\t\t\tprintf(\"(non-mbox) Adding cc: %s from line '%s'\\n\",\n \t\t\t\t\t\t$_, $_) unless $quiet;\n \n@@ -750,9 +775,10 @@ foreach my $t (@files) {\n \t\t} else {\n \t\t\t$message .=  $_;\n \t\t\tif (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) {\n+\t\t\t\tnext if ($suppress_cc{'sob'});\n \t\t\t\tmy $c = $2;\n \t\t\t\tchomp $c;\n-\t\t\t\tnext if ($c eq $sender and $suppress_from);\n+\t\t\t\tnext if ($c eq $sender and $suppress_cc{'self'});\n \t\t\t\tpush @cc, $c;\n \t\t\t\tprintf(\"(sob) Adding cc: %s from line '%s'\\n\",\n \t\t\t\t\t$c, $_) unless $quiet;\n@@ -761,7 +787,7 @@ foreach my $t (@files) {\n \t}\n \tclose F;\n \n-\tif (defined $cc_cmd) {\n+\tif (defined $cc_cmd && !$suppress_cc{'cccmd'}) {\n \t\topen(F, \"$cc_cmd $t |\")\n \t\t\tor die \"(cc-cmd) Could not execute '$cc_cmd'\";\n \t\twhile(<F>) {\n-- \n1.5.3.7\n"},{"id":"64081","messageId":"20071224210325.GA7242@mail.oracle.com","threadId":"11378","inReplyTo":"1198522902-12117-1-git-send-email-git@davidb.org","subject":"Re: [PATCH] git-send-email: Generalize auto-cc recipient mechanism.","fromName":"Joel Becker","fromEmail":"joel.becker@oracle.com","sentAt":"2007-12-24T21:03:25Z","receivedAt":"2007-12-24T21:03:25Z","isPatch":true,"sender":{"key":"joel.becker@oracle.com","avatar":null},"body":"On Mon, Dec 24, 2007 at 11:01:42AM -0800, David Brown wrote:\n> There are a few options to git-send-email to suppress the automatic\n> generation of 'Cc' fields: --suppress-from, and --signed-off-cc.  However,\n> there are other times that git-send-email automatically includes Cc'd\n> recipients.  This is not desirable for all development environments.\n> \n> Add a new option --suppress-cc, which can be specified one or more times to\n> list the categories of auto-cc fields that should be suppressed.  If not\n> specified, it defaults to values to give the same behavior as specified\n> by --suppress-from, and --signed-off-cc.  The categories are:\n> \n>   self   - patch sender.  Same as --suppress-from.\n>   author - patch author.\n>   cc     - cc lines mentioned in the patch.\n>   cccmd  - avoid running the cccmd.\n>   sob    - signed off by lines.\n\n+   all    - all of the above, thus only honoring '--to', '--cc', and\n             '--bcc'\n\nJoel\n\n-- \n\n\"The nice thing about egotists is that they don't talk about other\n people.\"\n         - Lucille S. Harper\n\nJoel Becker\nPrincipal Software Developer\nOracle\nE-mail: joel.becker@oracle.com\nPhone: (650) 506-8127\n"},{"id":"64082","messageId":"20071224212648.GA21070@old.davidb.org","threadId":"11378","inReplyTo":"20071224210325.GA7242@mail.oracle.com","subject":"[PATCH] git-send-email: Add --suppress-cc all","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2007-12-24T21:26:48Z","receivedAt":"2007-12-24T21:26:48Z","isPatch":true,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"Add the 'all' option to --suppress-cc, allowing easier suppression of\neverything.\n\nSigned-off-by: David Brown <git@davidb.org>\n---\nOn Mon, Dec 24, 2007 at 01:03:25PM -0800, Joel Becker wrote:\n\n>+   all    - all of the above, thus only honoring '--to', '--cc', and\n>             '--bcc'\n\nI can squash this with the other patch if that would be cleaner.\n\nDave\n\n  Documentation/git-send-email.txt |    2 +-\n  git-send-email.perl              |   11 ++++++++++-\n  2 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 432f336..fdfb56e 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -125,7 +125,7 @@ The --cc option must be repeated for each user you want on the cc list.\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.\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.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex cb9adf2..ef16824 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -275,7 +275,7 @@ my(%suppress_cc);\n  if (@suppress_cc) {\n  \tforeach my $entry (@suppress_cc) {\n  \t\tdie \"Unknown --suppress-cc field: '$entry'\\n\"\n-\t\t\tunless $entry =~ /^(cccmd|cc|author|self|sob)$/;\n+\t\t\tunless $entry =~ /^(all|cccmd|cc|author|self|sob)$/;\n  \t\t$suppress_cc{$entry} = 1;\n  \t}\n  } else {\n@@ -284,6 +284,15 @@ if (@suppress_cc) {\n  \t$suppress_cc{'sob'} = 1 unless $signed_off_cc;\n  }\n  \n+if ($suppress_cc{'all'}) {\n+\tforeach my $entry (qw (ccmd cc author self sob)) {\n+\t\t$suppress_cc{$entry} = 1;\n+\t}\n+\tdelete $suppress_cc{'all'};\n+}\n+\n+printf \"Suppressions: %s\\n\", join(',', keys(%suppress_cc));\n+\n  my ($repoauthor) = $repo->ident_person('author');\n  my ($repocommitter) = $repo->ident_person('committer');\n  \n-- \n1.5.3.7\n"},{"id":"64083","messageId":"1198532163-25308-1-git-send-email-git@davidb.org","threadId":"11378","inReplyTo":"1198216860-487-1-git-send-email-git@davidb.org","subject":"[PATCH] git-send-email: Generalize auto-cc recipient mechanism.","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2007-12-24T21:36:03Z","receivedAt":"2007-12-24T21:36:03Z","isPatch":true,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"There are a few options to git-send-email to suppress the automatic\ngeneration of 'Cc' fields: --suppress-from, and --signed-off-cc.\nHowever, there are other times that git-send-email automatically\nincludes Cc'd recipients.  This is not desirable for all development\nenvironments.\n\nAdd a new option --suppress-cc, which can be specified one or more\ntimes to list the categories of auto-cc fields that should be\nsuppressed.  If not specified, it defaults to values to give the same\nbehavior as specified by --suppress-from, and --signed-off-cc.  The\ncategories are:\n\n  self   - patch sender.  Same as --suppress-from.\n  author - patch author.\n  cc     - cc lines mentioned in the patch.\n  cccmd  - avoid running the cccmd.\n  sob    - signed off by lines.\n  all    - all non-explicit recipients\n\nSigned-off-by: David Brown <git@davidb.org>\n---\nAdds the 'all' category suggested by Joel Becker.\n\n Documentation/git-send-email.txt |   13 +++++++++++\n git-send-email.perl              |   42 ++++++++++++++++++++++++++++++++++---\n 2 files changed, 51 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex f0bd285..fdfb56e 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -70,6 +70,7 @@ The --cc option must be repeated for each user you want on the cc list.\n         cc list.\n         Default is the value of 'sendemail.signedoffcc' configuration value;\n         if that is unspecified, default to --signed-off-by-cc.\n+        Note that this has no effect if --suppress-cc is given.\n \n --quiet::\n \tMake git-send-email less verbose.  One line per email should be\n@@ -116,6 +117,18 @@ The --cc option must be repeated for each user you want on the cc list.\n         If this is set, do not add the From: address to the cc: list.\n         Default is the value of 'sendemail.suppressfrom' configuration value;\n         if that is unspecified, default to --no-suppress-from.\n+        Note that this has no effect if --suppress-cc is given.\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 \n --thread, --no-thread::\n \tIf this is set, the In-Reply-To header will be set on each email sent.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e47994a..00a7ffc 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -88,6 +88,12 @@ Options:\n \n    --smtp-ssl     If set, connects to the SMTP server using SSL.\n \n+   --suppress-cc  Suppress the specified category of auto-CC.  The category\n+                  can be one of 'author' for the patch author, 'self' to\n+                  avoid copying yourself, 'sob' for Signed-off-by lines,\n+                  'cccmd' for the output of the cccmd, or 'all' to suppress\n+                  all of these.\n+\n    --suppress-from Suppress sending emails to yourself. Defaults to off.\n \n    --thread       Specify that the \"In-Reply-To:\" header should be set on all\n@@ -177,6 +183,7 @@ my ($quiet, $dry_run) = (0, 0);\n my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);\n my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_authpass, $smtp_ssl);\n my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);\n+my (@suppress_cc);\n \n my %config_bool_settings = (\n     \"thread\" => [\\$thread, 1],\n@@ -196,6 +203,7 @@ my %config_settings = (\n     \"aliasfiletype\" => \\$aliasfiletype,\n     \"bcc\" => \\@bcclist,\n     \"aliasesfile\" => \\@alias_files,\n+    \"suppresscc\" => \\@suppress_cc,\n );\n \n # Begin by accumulating all the variables (defined above), that we will end up\n@@ -218,6 +226,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"quiet\" => \\$quiet,\n \t\t    \"cc-cmd=s\" => \\$cc_cmd,\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_cc,\n \t\t    \"dry-run\" => \\$dry_run,\n \t\t    \"envelope-sender=s\" => \\$envelope_sender,\n@@ -262,6 +271,27 @@ foreach my $setting (values %config_bool_settings) {\n \t${$setting->[0]} = $setting->[1] unless (defined (${$setting->[0]}));\n }\n \n+# Set CC suppressions\n+my(%suppress_cc);\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$suppress_cc{$entry} = 1;\n+\t}\n+} else {\n+\t# Convert the old-style options.\n+\t$suppress_cc{'self'} = 1 if $suppress_from;\n+\t$suppress_cc{'sob'} = 1 unless $signed_off_cc;\n+}\n+\n+if ($suppress_cc{'all'}) {\n+\tforeach my $entry (qw (ccmd cc author self sob)) {\n+\t\t$suppress_cc{$entry} = 1;\n+\t}\n+\tdelete $suppress_cc{'all'};\n+}\n+\n my ($repoauthor) = $repo->ident_person('author');\n my ($repocommitter) = $repo->ident_person('committer');\n \n@@ -701,11 +731,14 @@ foreach my $t (@files) {\n \n \t\t\t\t} elsif (/^(Cc|From):\\s+(.*)$/) {\n \t\t\t\t\tif (unquote_rfc2047($2) eq $sender) {\n-\t\t\t\t\t\tnext if ($suppress_from);\n+\t\t\t\t\t\tnext if ($suppress_cc{'self'});\n \t\t\t\t\t}\n \t\t\t\t\telsif ($1 eq 'From') {\n \t\t\t\t\t\t($author, $author_encoding)\n \t\t\t\t\t\t  = unquote_rfc2047($2);\n+\t\t\t\t\t\tnext if ($suppress_cc{'author'});\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\tnext if ($suppress_cc{'cc'});\n \t\t\t\t\t}\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@@ -732,7 +765,7 @@ foreach my $t (@files) {\n \t\t\t\t# line 2 = subject\n \t\t\t\t# So let's support that, too.\n \t\t\t\t$input_format = 'lots';\n-\t\t\t\tif (@cc == 0) {\n+\t\t\t\tif (@cc == 0 && !$suppress_cc{'cc'}) {\n \t\t\t\t\tprintf(\"(non-mbox) Adding cc: %s from line '%s'\\n\",\n \t\t\t\t\t\t$_, $_) unless $quiet;\n \n@@ -750,9 +783,10 @@ foreach my $t (@files) {\n \t\t} else {\n \t\t\t$message .=  $_;\n \t\t\tif (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) {\n+\t\t\t\tnext if ($suppress_cc{'sob'});\n \t\t\t\tmy $c = $2;\n \t\t\t\tchomp $c;\n-\t\t\t\tnext if ($c eq $sender and $suppress_from);\n+\t\t\t\tnext if ($c eq $sender and $suppress_cc{'self'});\n \t\t\t\tpush @cc, $c;\n \t\t\t\tprintf(\"(sob) Adding cc: %s from line '%s'\\n\",\n \t\t\t\t\t$c, $_) unless $quiet;\n@@ -761,7 +795,7 @@ foreach my $t (@files) {\n \t}\n \tclose F;\n \n-\tif (defined $cc_cmd) {\n+\tif (defined $cc_cmd && !$suppress_cc{'cccmd'}) {\n \t\topen(F, \"$cc_cmd $t |\")\n \t\t\tor die \"(cc-cmd) Could not execute '$cc_cmd'\";\n \t\twhile(<F>) {\n-- \n1.5.3.7\n"},{"id":"64084","messageId":"20071224215910.GK7242@mail.oracle.com","threadId":"11378","inReplyTo":"20071224212648.GA21070@old.davidb.org","subject":"Re: [PATCH] git-send-email: Add --suppress-cc all","fromName":"Joel Becker","fromEmail":"joel.becker@oracle.com","sentAt":"2007-12-24T21:59:10Z","receivedAt":"2007-12-24T21:59:10Z","isPatch":true,"sender":{"key":"joel.becker@oracle.com","avatar":null},"body":"On Mon, Dec 24, 2007 at 01:26:48PM -0800, David Brown wrote:\n> Add the 'all' option to --suppress-cc, allowing easier suppression of\n> everything.\n\n\tThank you!\n>\n> Signed-off-by: David Brown <git@davidb.org>\n> ---\n> On Mon, Dec 24, 2007 at 01:03:25PM -0800, Joel Becker wrote:\n>\n>> +   all    - all of the above, thus only honoring '--to', '--cc', and\n>>             '--bcc'\n>\n> I can squash this with the other patch if that would be cleaner.\n>\n> Dave\n>\n>  Documentation/git-send-email.txt |    2 +-\n>  git-send-email.perl              |   11 ++++++++++-\n>  2 files changed, 11 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n> index 432f336..fdfb56e 100644\n> --- a/Documentation/git-send-email.txt\n> +++ b/Documentation/git-send-email.txt\n> @@ -125,7 +125,7 @@ The --cc option must be repeated for each user you want on the cc list.\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.\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> diff --git a/git-send-email.perl b/git-send-email.perl\n> index cb9adf2..ef16824 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -275,7 +275,7 @@ my(%suppress_cc);\n>  if (@suppress_cc) {\n>  \tforeach my $entry (@suppress_cc) {\n>  \t\tdie \"Unknown --suppress-cc field: '$entry'\\n\"\n> -\t\t\tunless $entry =~ /^(cccmd|cc|author|self|sob)$/;\n> +\t\t\tunless $entry =~ /^(all|cccmd|cc|author|self|sob)$/;\n>  \t\t$suppress_cc{$entry} = 1;\n>  \t}\n>  } else {\n> @@ -284,6 +284,15 @@ if (@suppress_cc) {\n>  \t$suppress_cc{'sob'} = 1 unless $signed_off_cc;\n>  }\n>  +if ($suppress_cc{'all'}) {\n> +\tforeach my $entry (qw (ccmd cc author self sob)) {\n> +\t\t$suppress_cc{$entry} = 1;\n> +\t}\n> +\tdelete $suppress_cc{'all'};\n> +}\n> +\n> +printf \"Suppressions: %s\\n\", join(',', keys(%suppress_cc));\n> +\n>  my ($repoauthor) = $repo->ident_person('author');\n>  my ($repocommitter) = $repo->ident_person('committer');\n>  \n> -- \n> 1.5.3.7\n>\n\n-- \n\n\"Can any of you seriously say the Bill of Rights could get through\n Congress today?  It wouldn't even get out of committee.\"\n\t- F. Lee Bailey\n\nJoel Becker\nPrincipal Software Developer\nOracle\nE-mail: joel.becker@oracle.com\nPhone: (650) 506-8127\n"},{"id":"64097","messageId":"7vk5n2o58p.fsf@gitster.siamese.dyndns.org","threadId":"11378","inReplyTo":"1198532163-25308-1-git-send-email-git@davidb.org","subject":"Re: [PATCH] git-send-email: Generalize auto-cc recipient mechanism.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-25T21:04:54Z","receivedAt":"2007-12-25T21:04:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Brown <git@davidb.org> writes:\n\n> ...\n>   self   - patch sender.  Same as --suppress-from.\n>   author - patch author.\n>   cc     - cc lines mentioned in the patch.\n>   cccmd  - avoid running the cccmd.\n>   sob    - signed off by lines.\n>   all    - all non-explicit recipients\n>\n> Signed-off-by: David Brown <git@davidb.org>\n> ...\n> What bothers me most about this change is that --signed-of-cc\n> and --suppress-from are silently ignored if --suppress-cc is given, either\n> on the command line, or in the config.\n\nThe order in which various variables are set in the current code\nbefore your patch is like this:\n\n * my ($var) introduces them -- they are undefined at the\n   beginning;\n\n * GetOptions() may set them to explicit values;\n\n * read_config(), first for the specific sendemail identity and\n   then for the generic ones, fill the ones that are still\n   undefined;\n\n * the built-in default from %config_bool_settings are used to\n   fill the ones that are still undefined at this point;\n\nNow, I think you can build on top of the above by adding the\nfollowing after that sequence:\n\n * fill %suppress_cc with explicit @suppress_cc GetOptions and\n   read_config() read;\n\n * if the --suppress-from and/or --signed-off-by-cc, either from\n   GetOptions() or from read_config() are given, make them\n   override what @suppress_cc says.  So giving --suppress-cc=all\n   and --signed-off-by-cc at the same time will still send cc to\n   people who signed off the patch (because these old-style ones\n   are more specific).\n\nPerhaps something like this (untested, of course!) patch on top\nof yours.\n\n\n git-send-email.perl |   16 +++++++++-------\n 1 files changed, 9 insertions(+), 7 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 1f03d12..cde5ffb 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -188,8 +188,8 @@ my (@suppress_cc);\n my %config_bool_settings = (\n     \"thread\" => [\\$thread, 1],\n     \"chainreplyto\" => [\\$chain_reply_to, 1],\n-    \"suppressfrom\" => [\\$suppress_from, 0],\n-    \"signedoffcc\" => [\\$signed_off_cc, 1],\n+    \"suppressfrom\" => [\\$suppress_from, undef],\n+    \"signedoffcc\" => [\\$signed_off_cc, undef],\n     \"smtpssl\" => [\\$smtp_ssl, 0],\n );\n \n@@ -279,18 +279,20 @@ if (@suppress_cc) {\n \t\t\tunless $entry =~ /^(all|cccmd|cc|author|self|sob)$/;\n \t\t$suppress_cc{$entry} = 1;\n \t}\n-} else {\n-\t# Convert the old-style options.\n-\t$suppress_cc{'self'} = 1 if $suppress_from;\n-\t$suppress_cc{'sob'} = 1 unless $signed_off_cc;\n }\n-\n if ($suppress_cc{'all'}) {\n \tforeach my $entry (qw (ccmd cc author self sob)) {\n \t\t$suppress_cc{$entry} = 1;\n \t}\n \tdelete $suppress_cc{'all'};\n }\n+# If explicit old-style ones are specified, they trump supress-cc\n+if (defined $suppress_from) {\n+\t$suppress_cc{'self'} = $suppress_from;\n+}\n+if (defined $signed_off_cc) {\n+\t$suppress_cc{'sob'} = !$signed_off_cc;\n+}\n \n my ($repoauthor) = $repo->ident_person('author');\n my ($repocommitter) = $repo->ident_person('committer');\n"},{"id":"64099","messageId":"20071226033929.GA29406@old.davidb.org","threadId":"11378","inReplyTo":"7vk5n2o58p.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-send-email: Generalize auto-cc recipient mechanism.","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2007-12-26T03:39:29Z","receivedAt":"2007-12-26T03:39:29Z","isPatch":true,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"On Tue, Dec 25, 2007 at 01:04:54PM -0800, Junio C Hamano wrote:\n\n>+# If explicit old-style ones are specified, they trump supress-cc\n>+if (defined $suppress_from) {\n>+\t$suppress_cc{'self'} = $suppress_from;\n>+}\n>+if (defined $signed_off_cc) {\n>+\t$suppress_cc{'sob'} = !$signed_off_cc;\n>+}\n\nThis changes the default behavior to --no-signed-off-cc, if nothing is\nspecified.  I'll see if I can add something that will set that if no\nsuppress-cc's are set.\n\nPatch to follow shortly.\n\nDavid\n"},{"id":"64100","messageId":"1198641389-959-1-git-send-email-git@davidb.org","threadId":"11378","inReplyTo":"7vk5n2o58p.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] git-send-email: Generalize auto-cc recipient mechanism.","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2007-12-26T03:56:29Z","receivedAt":"2007-12-26T03:56:29Z","isPatch":true,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"There are a few options to git-send-email to suppress the automatic\ngeneration of 'Cc' fields: --suppress-from, and --signed-off-cc.\nHowever, there are other times that git-send-email automatically\nincludes Cc'd recipients.  This is not desirable for all development\nenvironments.\n\nAdd a new option --suppress-cc, which can be specified one or more\ntimes to list the categories of auto-cc fields that should be\nsuppressed.  If not specified, it defaults to values to give the same\nbehavior as specified by --suppress-from, and --signed-off-cc.  The\ncategories are:\n\n  self   - patch sender.  Same as --suppress-from.\n  author - patch author.\n  cc     - cc lines mentioned in the patch.\n  cccmd  - avoid running the cccmd.\n  sob    - signed off by lines.\n  all    - all non-explicit recipients\n\nSigned-off-by: David Brown <git@davidb.org>\n---\nI've now added changes similar to those suggested by Junio Hamano so\nthat signed-off-cc and suppress-from override values set by\nsigned-off-by.\n\nDave\n\n Documentation/git-send-email.txt |   11 +++++++\n git-send-email.perl              |   56 +++++++++++++++++++++++++++++++++-----\n 2 files changed, 60 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex f0bd285..3dcea86 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -117,6 +117,17 @@ The --cc option must be repeated for each user you want on the cc list.\n         Default is the value of 'sendemail.suppressfrom' configuration value;\n         if that is unspecified, default to --no-suppress-from.\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+\n --thread, --no-thread::\n \tIf this is set, the In-Reply-To header will be set on each email sent.\n \tIf disabled with \"--no-thread\", no emails will have the In-Reply-To\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e47994a..a4cf4a9 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -88,6 +88,12 @@ Options:\n \n    --smtp-ssl     If set, connects to the SMTP server using SSL.\n \n+   --suppress-cc  Suppress the specified category of auto-CC.  The category\n+                  can be one of 'author' for the patch author, 'self' to\n+                  avoid copying yourself, 'sob' for Signed-off-by lines,\n+                  'cccmd' for the output of the cccmd, or 'all' to suppress\n+                  all of these.\n+\n    --suppress-from Suppress sending emails to yourself. Defaults to off.\n \n    --thread       Specify that the \"In-Reply-To:\" header should be set on all\n@@ -177,12 +183,13 @@ my ($quiet, $dry_run) = (0, 0);\n my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);\n my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_authpass, $smtp_ssl);\n my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);\n+my (@suppress_cc);\n \n my %config_bool_settings = (\n     \"thread\" => [\\$thread, 1],\n     \"chainreplyto\" => [\\$chain_reply_to, 1],\n-    \"suppressfrom\" => [\\$suppress_from, 0],\n-    \"signedoffcc\" => [\\$signed_off_cc, 1],\n+    \"suppressfrom\" => [\\$suppress_from, undef],\n+    \"signedoffcc\" => [\\$signed_off_cc, undef],\n     \"smtpssl\" => [\\$smtp_ssl, 0],\n );\n \n@@ -196,6 +203,7 @@ my %config_settings = (\n     \"aliasfiletype\" => \\$aliasfiletype,\n     \"bcc\" => \\@bcclist,\n     \"aliasesfile\" => \\@alias_files,\n+    \"suppresscc\" => \\@suppress_cc,\n );\n \n # Begin by accumulating all the variables (defined above), that we will end up\n@@ -218,6 +226,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"quiet\" => \\$quiet,\n \t\t    \"cc-cmd=s\" => \\$cc_cmd,\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_cc,\n \t\t    \"dry-run\" => \\$dry_run,\n \t\t    \"envelope-sender=s\" => \\$envelope_sender,\n@@ -262,6 +271,35 @@ foreach my $setting (values %config_bool_settings) {\n \t${$setting->[0]} = $setting->[1] unless (defined (${$setting->[0]}));\n }\n \n+# Set CC suppressions\n+my(%suppress_cc);\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$suppress_cc{$entry} = 1;\n+\t}\n+}\n+\n+if ($suppress_cc{'all'}) {\n+\tforeach my $entry (qw (ccmd cc author self sob)) {\n+\t\t$suppress_cc{$entry} = 1;\n+\t}\n+\tdelete $suppress_cc{'all'};\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+$suppress_cc{'sob'} = $signed_off_cc if defined $signed_off_cc;\n+\n+# Debugging, print out the suppressions.\n+if (0) {\n+\tprint \"suppressions:\\n\";\n+\tforeach my $entry (keys %suppress_cc) {\n+\t\tprintf \"  %-5s -> $suppress_cc{$entry}\\n\", $entry;\n+\t}\n+}\n+\n my ($repoauthor) = $repo->ident_person('author');\n my ($repocommitter) = $repo->ident_person('committer');\n \n@@ -701,11 +739,14 @@ foreach my $t (@files) {\n \n \t\t\t\t} elsif (/^(Cc|From):\\s+(.*)$/) {\n \t\t\t\t\tif (unquote_rfc2047($2) eq $sender) {\n-\t\t\t\t\t\tnext if ($suppress_from);\n+\t\t\t\t\t\tnext if ($suppress_cc{'self'});\n \t\t\t\t\t}\n \t\t\t\t\telsif ($1 eq 'From') {\n \t\t\t\t\t\t($author, $author_encoding)\n \t\t\t\t\t\t  = unquote_rfc2047($2);\n+\t\t\t\t\t\tnext if ($suppress_cc{'author'});\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\tnext if ($suppress_cc{'cc'});\n \t\t\t\t\t}\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@@ -732,7 +773,7 @@ foreach my $t (@files) {\n \t\t\t\t# line 2 = subject\n \t\t\t\t# So let's support that, too.\n \t\t\t\t$input_format = 'lots';\n-\t\t\t\tif (@cc == 0) {\n+\t\t\t\tif (@cc == 0 && !$suppress_cc{'cc'}) {\n \t\t\t\t\tprintf(\"(non-mbox) Adding cc: %s from line '%s'\\n\",\n \t\t\t\t\t\t$_, $_) unless $quiet;\n \n@@ -749,10 +790,11 @@ foreach my $t (@files) {\n \t\t\t}\n \t\t} else {\n \t\t\t$message .=  $_;\n-\t\t\tif (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) {\n+\t\t\tif (/^(Signed-off-by|Cc): (.*)$/i) {\n+\t\t\t\tnext if ($suppress_cc{'sob'});\n \t\t\t\tmy $c = $2;\n \t\t\t\tchomp $c;\n-\t\t\t\tnext if ($c eq $sender and $suppress_from);\n+\t\t\t\tnext if ($c eq $sender and $suppress_cc{'self'});\n \t\t\t\tpush @cc, $c;\n \t\t\t\tprintf(\"(sob) Adding cc: %s from line '%s'\\n\",\n \t\t\t\t\t$c, $_) unless $quiet;\n@@ -761,7 +803,7 @@ foreach my $t (@files) {\n \t}\n \tclose F;\n \n-\tif (defined $cc_cmd) {\n+\tif (defined $cc_cmd && !$suppress_cc{'cccmd'}) {\n \t\topen(F, \"$cc_cmd $t |\")\n \t\t\tor die \"(cc-cmd) Could not execute '$cc_cmd'\";\n \t\twhile(<F>) {\n-- \n1.5.3.7\n"},{"id":"64101","messageId":"BAYC1-PASMTP131135B69209F6EB72F809AE5B0@CEZ.ICE","threadId":"11378","inReplyTo":"1198641389-959-1-git-send-email-git@davidb.org","subject":"Re: [PATCH] git-send-email: Generalize auto-cc recipient mechanism.","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2007-12-26T04:54:38Z","receivedAt":"2007-12-26T04:54:38Z","isPatch":true,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Tue, 25 Dec 2007 19:56:29 -0800\nDavid Brown <git@davidb.org> wrote:\n\n> Add a new option --suppress-cc, which can be specified one or more\n> times to list the categories of auto-cc fields that should be\n> suppressed.  If not specified, it defaults to values to give the same\n> behavior as specified by --suppress-from, and --signed-off-cc.  The\n> categories are:\n> \n>   self   - patch sender.  Same as --suppress-from.\n>   author - patch author.\n>   cc     - cc lines mentioned in the patch.\n>   cccmd  - avoid running the cccmd.\n>   sob    - signed off by lines.\n>   all    - all non-explicit recipients\n> \n\nHi Dave,\n\nIt's great to see you're taking care of this issue, it's one that i've tripped over\na few times.  If your patch is accepted as-is, i think it's an improvement.\n\nBut i wonder about the case where a user has \"sendemail.suppresscc = all\" in their\n~/.gitconfig.   For the occasion when they do want to cc the author of\na patch, what do they do?  The above UI seems to lack a way to enable a cc option\nthat has been disabled by default.\n\nCheers,\nSean\n"},{"id":"64102","messageId":"20071226053221.GA4499@old.davidb.org","threadId":"11378","inReplyTo":"BAYC1-PASMTP131135B69209F6EB72F809AE5B0@CEZ.ICE","subject":"Re: [PATCH] git-send-email: Generalize auto-cc recipient mechanism.","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2007-12-26T05:32:21Z","receivedAt":"2007-12-26T05:32:21Z","isPatch":true,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"On Tue, Dec 25, 2007 at 11:54:38PM -0500, Sean wrote:\n\n>But i wonder about the case where a user has \"sendemail.suppresscc = all\" in their\n>~/.gitconfig.   For the occasion when they do want to cc the author of\n>a patch, what do they do?  The above UI seems to lack a way to enable a cc option\n>that has been disabled by default.\n\nWell, in that instance, --no-suppress-from would override that, if I did it\nright.  Perhaps we could add an unsuppress-cc option, but then the whole\nthing is starting to get more complicated than I think it really needs to\nbe.\n\nMy suggestion would be to keep this patch as is, and if the people using it\ndecide they want the override option, we/I can figure out how to add it.\n\nDave\n"}]}