{"thread":{"id":"45994","subject":"[PATCH] send-email: Add tocmd option to suppress-cc","startedAt":"2017-05-18T11:35:58Z","lastAt":"2017-06-14T03:48:05Z","messageCount":7,"participants":["Viresh Kumar","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"320154","messageId":"6367777092d93a62cc83c444061dde853ba3369e.1495107179.git.viresh.kumar@linaro.org","threadId":"45994","inReplyTo":null,"subject":"[PATCH] send-email: Add tocmd option to suppress-cc","fromName":"Viresh Kumar","fromEmail":"viresh.kumar@linaro.org","sentAt":"2017-05-18T11:35:33Z","receivedAt":"2017-05-18T11:35:58Z","isPatch":true,"sender":{"key":"viresh.kumar@linaro.org","avatar":"https://gravatar.com/avatar/938b1abce576d6c6d2734c01fce1c75040618c8fc0d1b7e836277ecd9f35fb19?d=mp&s=160"},"body":"This adds tocmd option to suppress-cc command which already supports\ncccmd and others.\n\nSigned-off-by: Viresh Kumar <viresh.kumar@linaro.org>\n---\n Documentation/git-send-email.txt | 1 +\n git-send-email.perl              | 8 ++++----\n 2 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 9d66166f69d9..f1634f7db3df 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -307,6 +307,7 @@ Automating\n   patch body (commit message) except for self (use 'self' for that).\n - 'sob' will avoid including anyone mentioned in Signed-off-by lines except\n    for self (use 'self' for that).\n+- 'tocmd' will avoid running the --to-cmd.\n - 'cccmd' will avoid running the --cc-cmd.\n - 'body' is equivalent to 'sob' + 'bodycc'\n - 'all' will suppress all auto cc values.\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex eea0a517f71b..cc3cd984aee4 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -85,7 +85,7 @@ git send-email --dump-aliases\n     --identity              <str>  * Use the sendemail.<id> 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+    --suppress-cc           <str>  * author, self, sob, cc, tocmd, 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.\n     --[no-]signed-off-by-cc        * Send to Signed-off-by: addresses. Default on.\n@@ -435,13 +435,13 @@ my(%suppress_cc);\n if (@suppress_cc) {\n \tforeach my $entry (@suppress_cc) {\n \t\tdie sprintf(__(\"Unknown --suppress-cc field: '%s'\\n\"), $entry)\n-\t\t\tunless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc)$/;\n+\t\t\tunless $entry =~ /^(?:all|tocmd|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 (cccmd cc author self sob body bodycc)) {\n+\tforeach my $entry (qw (tocmd cccmd cc author self sob body bodycc)) {\n \t\t$suppress_cc{$entry} = 1;\n \t}\n \tdelete $suppress_cc{'all'};\n@@ -1582,7 +1582,7 @@ foreach my $t (@files) {\n \tclose $fh;\n \n \tpush @to, recipients_cmd(\"to-cmd\", \"to\", $to_cmd, $t)\n-\t\tif defined $to_cmd;\n+\t\tif defined $to_cmd && !$suppress_cc{'tocmd'};\n \tpush @cc, recipients_cmd(\"cc-cmd\", \"cc\", $cc_cmd, $t)\n \t\tif defined $cc_cmd && !$suppress_cc{'cccmd'};\n \n-- \n2.13.0.70.g6367777092d9\n\n"},{"id":"321944","messageId":"20170612043313.GE5297@vireshk-i7","threadId":"45994","inReplyTo":"6367777092d93a62cc83c444061dde853ba3369e.1495107179.git.viresh.kumar@linaro.org","subject":"Re: [PATCH] send-email: Add tocmd option to suppress-cc","fromName":"Viresh Kumar","fromEmail":"viresh.kumar@linaro.org","sentAt":"2017-06-12T04:33:13Z","receivedAt":"2017-06-12T04:33:23Z","isPatch":true,"sender":{"key":"viresh.kumar@linaro.org","avatar":"https://gravatar.com/avatar/938b1abce576d6c6d2734c01fce1c75040618c8fc0d1b7e836277ecd9f35fb19?d=mp&s=160"},"body":"On 18-05-17, 17:05, Viresh Kumar wrote:\n> This adds tocmd option to suppress-cc command which already supports\n> cccmd and others.\n> \n> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>\n> ---\n>  Documentation/git-send-email.txt | 1 +\n>  git-send-email.perl              | 8 ++++----\n>  2 files changed, 5 insertions(+), 4 deletions(-)\n\nPing !!\n\n-- \nviresh\n"},{"id":"321961","messageId":"xmqq8tkxp4nw.fsf@gitster.mtv.corp.google.com","threadId":"45994","inReplyTo":"20170612043313.GE5297@vireshk-i7","subject":"Re: [PATCH] send-email: Add tocmd option to suppress-cc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-12T16:11:15Z","receivedAt":"2017-06-12T16:11:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Viresh Kumar <viresh.kumar@linaro.org> writes:\n\n> On 18-05-17, 17:05, Viresh Kumar wrote:\n>> This adds tocmd option to suppress-cc command which already supports\n>> cccmd and others.\n>> \n>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>\n>> ---\n>>  Documentation/git-send-email.txt | 1 +\n>>  git-send-email.perl              | 8 ++++----\n>>  2 files changed, 5 insertions(+), 4 deletions(-)\n>\n> Ping !!\n\nPong?\n\nI didn't get the impression that in the discussion that led to your\npatch (or in any response to the patch) we established that it is a\ngood idea to change the behaviour of suppress-cc unconditionally\nlike this patch does.\n\n"},{"id":"321975","messageId":"xmqqmv9dnkut.fsf@gitster.mtv.corp.google.com","threadId":"45994","inReplyTo":"xmqq8tkxp4nw.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] send-email: Add tocmd option to suppress-cc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-12T18:04:26Z","receivedAt":"2017-06-12T18:04:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Viresh Kumar <viresh.kumar@linaro.org> writes:\n>\n>> On 18-05-17, 17:05, Viresh Kumar wrote:\n>>> This adds tocmd option to suppress-cc command which already supports\n>>> cccmd and others.\n>>> \n>>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>\n>>> ---\n>>>  Documentation/git-send-email.txt | 1 +\n>>>  git-send-email.perl              | 8 ++++----\n>>>  2 files changed, 5 insertions(+), 4 deletions(-)\n>>\n>> Ping !!\n>\n> Pong?\n>\n> I didn't get the impression that in the discussion that led to your\n> patch (or in any response to the patch) we established that it is a\n> good idea to change the behaviour of suppress-cc unconditionally\n> like this patch does.\n\nI think suppress-cc that suppresses cccmd output is very sensible\n(after all, it is about suppressing CC and cccmd is about producing\nCC), but I am not convinced that it is a good idea to suppress tocmd\n(which is about producing To) via suppress-cc.\n\nGoing back to the core part of your change, i.e.\n\n-\tforeach my $entry (qw (cccmd cc author self sob body bodycc)) {\n+\tforeach my $entry (qw (tocmd cccmd cc author self sob body bodycc)) {\n\nto think about it a bit more, I notice that all the existing ones\nare about CC.  So I am not just not convinced that tocmd belongs to\nthe same class.  I am inclined to say that it smells quite different\nfrom others.\n"},{"id":"322045","messageId":"20170613034337.GF5297@vireshk-i7","threadId":"45994","inReplyTo":"xmqqmv9dnkut.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] send-email: Add tocmd option to suppress-cc","fromName":"Viresh Kumar","fromEmail":"viresh.kumar@linaro.org","sentAt":"2017-06-13T03:43:37Z","receivedAt":"2017-06-13T03:43:48Z","isPatch":true,"sender":{"key":"viresh.kumar@linaro.org","avatar":"https://gravatar.com/avatar/938b1abce576d6c6d2734c01fce1c75040618c8fc0d1b7e836277ecd9f35fb19?d=mp&s=160"},"body":"On 12-06-17, 11:04, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Viresh Kumar <viresh.kumar@linaro.org> writes:\n> >\n> >> On 18-05-17, 17:05, Viresh Kumar wrote:\n> >>> This adds tocmd option to suppress-cc command which already supports\n> >>> cccmd and others.\n> >>> \n> >>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>\n> >>> ---\n> >>>  Documentation/git-send-email.txt | 1 +\n> >>>  git-send-email.perl              | 8 ++++----\n> >>>  2 files changed, 5 insertions(+), 4 deletions(-)\n> >>\n> >> Ping !!\n> >\n> > Pong?\n> >\n> > I didn't get the impression that in the discussion that led to your\n> > patch (or in any response to the patch) we established that it is a\n> > good idea to change the behaviour of suppress-cc unconditionally\n> > like this patch does.\n\nYeah, there were no conclusions there but we agreed that we have a\nproblem to solve. And this patch tried one of the ways.\n\n> I think suppress-cc that suppresses cccmd output is very sensible\n> (after all, it is about suppressing CC and cccmd is about producing\n> CC), but I am not convinced that it is a good idea to suppress tocmd\n> (which is about producing To) via suppress-cc.\n> \n> Going back to the core part of your change, i.e.\n> \n> -\tforeach my $entry (qw (cccmd cc author self sob body bodycc)) {\n> +\tforeach my $entry (qw (tocmd cccmd cc author self sob body bodycc)) {\n> \n> to think about it a bit more, I notice that all the existing ones\n> are about CC.  So I am not just not convinced that tocmd belongs to\n> the same class.  I am inclined to say that it smells quite different\n> from others.\n\nThat's right but how do we solve this problem then?\n\nAdd another optional argument like suppress-to ? I thought that it\nwould be better to override suppress-cc rather than attempting any\nsuch thing.\n\nI am fine with any solution that address the concerns raised by this\npatch though.\n\n-- \nviresh\n"},{"id":"322113","messageId":"xmqqk24f7qep.fsf@gitster.mtv.corp.google.com","threadId":"45994","inReplyTo":"20170613034337.GF5297@vireshk-i7","subject":"Re: [PATCH] send-email: Add tocmd option to suppress-cc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-13T17:23:26Z","receivedAt":"2017-06-13T17:23:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Viresh Kumar <viresh.kumar@linaro.org> writes:\n\n>> Going back to the core part of your change, i.e.\n>> \n>> -\tforeach my $entry (qw (cccmd cc author self sob body bodycc)) {\n>> +\tforeach my $entry (qw (tocmd cccmd cc author self sob body bodycc)) {\n>> \n>> to think about it a bit more, I notice that all the existing ones\n>> are about CC.  So I am not just not convinced that tocmd belongs to\n>> the same class.  I am inclined to say that it smells quite different\n>> from others.\n>\n> That's right but how do we solve this problem then?\n>\n> Add another optional argument like suppress-to ? I thought that it\n> would be better to override suppress-cc rather than attempting any\n> such thing.\n>\n> I am fine with any solution that address the concerns raised by this\n> patch though.\n\nI am not sure what problem is being solved, quite honestly.  \"I have\ntocmd configured and I want a way not to specify tocmd for a single\ninvocation?\"  Would something along the lines of \n\n    git -c sendemail.tocmd=true send-email ...\n\nhow you do it in general?  Do you want a prettier-looking\nequivalent, e.g.\n\n    git send-email --tocmd=true ...\n\nor something like that?\n\n\n\n"},{"id":"322184","messageId":"20170614034754.GI5297@vireshk-i7","threadId":"45994","inReplyTo":"xmqqk24f7qep.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] send-email: Add tocmd option to suppress-cc","fromName":"Viresh Kumar","fromEmail":"viresh.kumar@linaro.org","sentAt":"2017-06-14T03:47:54Z","receivedAt":"2017-06-14T03:48:05Z","isPatch":true,"sender":{"key":"viresh.kumar@linaro.org","avatar":"https://gravatar.com/avatar/938b1abce576d6c6d2734c01fce1c75040618c8fc0d1b7e836277ecd9f35fb19?d=mp&s=160"},"body":"On 13-06-17, 10:23, Junio C Hamano wrote:\n> Viresh Kumar <viresh.kumar@linaro.org> writes:\n> \n> >> Going back to the core part of your change, i.e.\n> >> \n> >> -\tforeach my $entry (qw (cccmd cc author self sob body bodycc)) {\n> >> +\tforeach my $entry (qw (tocmd cccmd cc author self sob body bodycc)) {\n> >> \n> >> to think about it a bit more, I notice that all the existing ones\n> >> are about CC.  So I am not just not convinced that tocmd belongs to\n> >> the same class.  I am inclined to say that it smells quite different\n> >> from others.\n> >\n> > That's right but how do we solve this problem then?\n> >\n> > Add another optional argument like suppress-to ? I thought that it\n> > would be better to override suppress-cc rather than attempting any\n> > such thing.\n> >\n> > I am fine with any solution that address the concerns raised by this\n> > patch though.\n> \n> I am not sure what problem is being solved, quite honestly.  \"I have\n> tocmd configured and I want a way not to specify tocmd for a single\n> invocation?\"  Would something along the lines of \n> \n>     git -c sendemail.tocmd=true send-email ...\n> \n> how you do it in general?\n\nYeah, it works. I can use this instead.\n\nThis patch can be dropped now. Thanks.\n\n-- \nviresh\n"}]}