{"thread":{"id":"27948","subject":"[PATCH] git-send-email: Add auto-cc to all body signatures","startedAt":"2011-07-29T01:34:37Z","lastAt":"2015-12-02T18:28:58Z","messageCount":10,"participants":["Joe Perches","Jeff Kirsher","Junio C Hamano","Rasmus Villemoes"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"172314","messageId":"b2937bc06d1bff456b84e51d6edee0bb1afc5f31.1311902983.git.joe@perches.com","threadId":"27948","inReplyTo":null,"subject":"[PATCH] git-send-email: Add auto-cc to all body signatures","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2011-07-29T01:34:37Z","receivedAt":"2011-07-29T01:34:37Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"Many types of signatures are used by various projects.\n\nThe most common type is formatted:\n\t\"[some_signature_type]-by: First Last <email@domain.tld>\"\ne.g:\n\t\"Reported-by: First Last <email@domain.tld>\" (no quotes are used)\n\nMake git-send-email use these signatures as \"CC:\" entries.\n\nAdd command line option --suppress-cc=signatures to avoid\nadding these entries to the cc.\n\nSigned-off-by: Joe Perches <joe@perches.com>\n---\n Documentation/git-send-email.txt |    3 ++-\n git-send-email.perl              |   11 ++++++-----\n 2 files changed, 8 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 327233c..17ea825 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -246,8 +246,9 @@ 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+- 'signatures' will avoid including anyone mentioned in any \"<foo>-by:\" lines.\n - 'cccmd' will avoid running the --cc-cmd.\n-- 'body' is equivalent to 'sob' + 'bodycc'\n+- 'body' is equivalent to 'sob' + 'bodycc + signatures'\n - 'all' will suppress all auto cc values.\n --\n +\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 98ab33a..973ed65 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -75,7 +75,7 @@ git send-email [options] <file | directory | rev-list options >\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, cccmd, body, bodycc, signatures, 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 off.\n@@ -374,13 +374,13 @@ 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|body|bodycc)$/;\n+\t\t\tunless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc|signatures)$/;\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 (cccmd cc author self sob body bodycc signatures)) {\n \t\t$suppress_cc{$entry} = 1;\n \t}\n \tdelete $suppress_cc{'all'};\n@@ -391,7 +391,7 @@ $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+\tforeach my $entry (qw (sob bodycc signatures)) {\n \t\t$suppress_cc{$entry} = 1;\n \t}\n \tdelete $suppress_cc{'body'};\n@@ -1251,7 +1251,7 @@ foreach my $t (@files) {\n \t# Now parse the message body\n \twhile(<$fh>) {\n \t\t$message .=  $_;\n-\t\tif (/^(Signed-off-by|Cc): (.*)$/i) {\n+\t\tif (/^(Signed-off-by|Cc|[a-z_-]+by): (.*)$/i) {\n \t\t\tchomp;\n \t\t\tmy ($what, $c) = ($1, $2);\n \t\t\tchomp $c;\n@@ -1260,6 +1260,7 @@ foreach my $t (@files) {\n \t\t\t} else {\n \t\t\t\tnext if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;\n \t\t\t\tnext if $suppress_cc{'bodycc'} and $what =~ /Cc/i;\n+\t\t\t\tnext if $suppress_cc{'signatures'} and $what =~ /by$/i;\n \t\t\t}\n \t\t\tpush @cc, $c;\n \t\t\tprintf(\"(body) Adding cc: %s from line '%s'\\n\",\n-- \n1.7.6.131.g99019\n"},{"id":"172315","messageId":"1311903782.20837.42.camel@jtkirshe-mobl","threadId":"27948","inReplyTo":"b2937bc06d1bff456b84e51d6edee0bb1afc5f31.1311902983.git.joe@perches.com","subject":"Re: [PATCH] git-send-email: Add auto-cc to all body signatures","fromName":"Jeff Kirsher","fromEmail":"jeffrey.t.kirsher@intel.com","sentAt":"2011-07-29T01:43:01Z","receivedAt":"2011-07-29T01:43:01Z","isPatch":true,"sender":{"key":"jeffrey.t.kirsher@intel.com","avatar":null},"body":"On Thu, 2011-07-28 at 18:34 -0700, Joe Perches wrote:\n> Many types of signatures are used by various projects.\n> \n> The most common type is formatted:\n>         \"[some_signature_type]-by: First Last <email@domain.tld>\"\n> e.g:\n>         \"Reported-by: First Last <email@domain.tld>\" (no quotes are\n> used)\n> \n> Make git-send-email use these signatures as \"CC:\" entries.\n> \n> Add command line option --suppress-cc=signatures to avoid\n> adding these entries to the cc.\n> \n> Signed-off-by: Joe Perches <joe@perches.com> \n\nAcked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>\n\nThanks, I was getting tired of having to add CC: <blah> especially since\nwe already had Reported-by: <blah> and Tested-by: <blah>, yet they were\nnever copied on the patch.\n"},{"id":"180550","messageId":"1323313119.1762.58.camel@joe2Laptop","threadId":"27948","inReplyTo":"1311903782.20837.42.camel@jtkirshe-mobl","subject":"[PATCH] git-send-email: Add auto-cc to all body signatures","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2011-12-08T02:58:39Z","receivedAt":"2011-12-08T02:58:39Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"Many types of signatures are used by various projects.\n\nThe most common type is formatted:\n\t\"[some_signature_type]-by: First Last <email@domain.tld>\"\ne.g:\n\t\"Reported-by: First Last <email@domain.tld>\" (no quotes are used)\n\nMake git-send-email use these signatures as \"CC:\" entries.\n\nAdd command line option --suppress-cc=signatures to avoid\nadding these entries to the cc.\n\nSigned-off-by: Joe Perches <joe@perches.com>\nAcked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>\n---\n Documentation/git-send-email.txt |    3 ++-\n git-send-email.perl              |   11 ++++++-----\n 2 files changed, 8 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 327233c..17ea825 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -246,8 +246,9 @@ 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+- 'signatures' will avoid including anyone mentioned in any \"<foo>-by:\" lines.\n - 'cccmd' will avoid running the --cc-cmd.\n-- 'body' is equivalent to 'sob' + 'bodycc'\n+- 'body' is equivalent to 'sob' + 'bodycc + signatures'\n - 'all' will suppress all auto cc values.\n --\n +\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex d491db9..fc5bf41 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -75,7 +75,7 @@ git send-email [options] <file | directory | rev-list options >\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, cccmd, body, bodycc, signatures, 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 off.\n@@ -393,13 +393,13 @@ 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|body|bodycc)$/;\n+\t\t\tunless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc|signatures)$/;\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 (cccmd cc author self sob body bodycc signatures)) {\n \t\t$suppress_cc{$entry} = 1;\n \t}\n \tdelete $suppress_cc{'all'};\n@@ -410,7 +410,7 @@ $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+\tforeach my $entry (qw (sob bodycc signatures)) {\n \t\t$suppress_cc{$entry} = 1;\n \t}\n \tdelete $suppress_cc{'body'};\n@@ -1276,7 +1276,7 @@ foreach my $t (@files) {\n \t# Now parse the message body\n \twhile(<$fh>) {\n \t\t$message .=  $_;\n-\t\tif (/^(Signed-off-by|Cc): (.*)$/i) {\n+\t\tif (/^(Signed-off-by|Cc|[a-z_-]+by): (.*)$/i) {\n \t\t\tchomp;\n \t\t\tmy ($what, $c) = ($1, $2);\n \t\t\tchomp $c;\n@@ -1285,6 +1285,7 @@ foreach my $t (@files) {\n \t\t\t} else {\n \t\t\t\tnext if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;\n \t\t\t\tnext if $suppress_cc{'bodycc'} and $what =~ /Cc/i;\n+\t\t\t\tnext if $suppress_cc{'signatures'} and $what =~ /by$/i;\n \t\t\t}\n \t\t\tpush @cc, $c;\n \t\t\tprintf(\"(body) Adding cc: %s from line '%s'\\n\",\n-- \n1.7.8.dirty\n"},{"id":"180608","messageId":"7v8vmmj1ng.fsf@alter.siamese.dyndns.org","threadId":"27948","inReplyTo":"1323313119.1762.58.camel@joe2Laptop","subject":"Re: [PATCH] git-send-email: Add auto-cc to all body signatures","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-08T19:37:07Z","receivedAt":"2011-12-08T19:37:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Joe Perches <joe@perches.com> writes:\n\n> Many types of signatures are used by various projects.\n>\n> The most common type is formatted:\n> \t\"[some_signature_type]-by: First Last <email@domain.tld>\"\n> e.g:\n> \t\"Reported-by: First Last <email@domain.tld>\" (no quotes are used)\n\nThis is just a phrasing issue, but I am a bit reluctant about the name\n\"signature\". \"Acked-by:\", \"Tested-by:\" and \"Reviewed-by:\" are originally\nwritten in the message sent to the author by the person who is giving an\nAck, a successful test report, and a review comment, and the author (at\nleast in spirit) copies & pastes them to the final text used in the commit\nlog message, so it would not be incorrect to call them \"signatures\". But\nother \"Random-by:\" would not fall into that pattern.\n\n\"Reported-by:\" certainly does not.  It is almost always added by the\nauthor of the patch that is different from the reporter, and the reporter\nwouldn't have written \"Reported-by: me\" in the original bug report that\ntriggered the discussion and resulted in the commit to fix the bug. Such a\nline is certainly not a signature of/by the reporter. Same can be said for\n\"Helped-by:\" for the author to share credits.\n\nAlso I've seen these \"Random-by:\", especially the ones that the author\nadds on his own initiative like \"Reported-by:\", followed by just a name\nbut not an addresses [*1*].\n\nDoes your change do the right thing on such an address-less entry?  The\nanswer to this question must start with the definition of \"the right thing\nto do is X\", of course.\n\n> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n> index 327233c..17ea825 100644\n> --- a/Documentation/git-send-email.txt\n> +++ b/Documentation/git-send-email.txt\n> @@ -246,8 +246,9 @@ 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> +- 'signatures' will avoid including anyone mentioned in any \"<foo>-by:\" lines.\n>  - 'cccmd' will avoid running the --cc-cmd.\n> -- 'body' is equivalent to 'sob' + 'bodycc'\n> +- 'body' is equivalent to 'sob' + 'bodycc + signatures'\n\nThe quotes do not match quite well.\n\n\n[Footnote]\n\n*1* This seems to be done deliberately so; I understand that this is to\navoid running afoul of EU privacy legislation or something.\n"},{"id":"180616","messageId":"1323377486.1762.71.camel@joe2Laptop","threadId":"27948","inReplyTo":"7v8vmmj1ng.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-send-email: Add auto-cc to all body signatures","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2011-12-08T20:51:26Z","receivedAt":"2011-12-08T20:51:26Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Thu, 2011-12-08 at 11:37 -0800, Junio C Hamano wrote:\n> Joe Perches <joe@perches.com> writes:\n> > Many types of signatures are used by various projects.\n> > The most common type is formatted:\n> > \t\"[some_signature_type]-by: First Last <email@domain.tld>\"\n> > e.g:\n> > \t\"Reported-by: First Last <email@domain.tld>\" (no quotes are used)\n> This is just a phrasing issue, but I am a bit reluctant about the name\n> \"signature\".\n\nI've called all these markings signatures.\nMaybe email-address-tags or another name could be used.\nI'm not bothered one way or another by any chosen name.\n\n> Does your change do the right thing on such an address-less entry?  The\n> answer to this question must start with the definition of \"the right thing\n> to do is X\", of course.\n\nAll addresses go through \"extract_valid_address\".\nInvalid addresses are not used.\n"},{"id":"273906","messageId":"87mvtti2ul.fsf@rasmusvillemoes.dk","threadId":"27948","inReplyTo":"1323377486.1762.71.camel@joe2Laptop","subject":"Re: [PATCH] git-send-email: Add auto-cc to all body signatures","fromName":"Rasmus Villemoes","fromEmail":"rv@rasmusvillemoes.dk","sentAt":"2015-12-02T10:04:02Z","receivedAt":"2015-12-02T10:04:02Z","isPatch":true,"sender":{"key":"rv@rasmusvillemoes.dk","avatar":"https://avatars.githubusercontent.com/u/4375908?v=4"},"body":"On Thu, Dec 08 2011, Joe Perches <joe@perches.com> wrote:\n\n> On Thu, 2011-12-08 at 11:37 -0800, Junio C Hamano wrote:\n>> Joe Perches <joe@perches.com> writes:\n>> > Many types of signatures are used by various projects.\n>> > The most common type is formatted:\n>> > \t\"[some_signature_type]-by: First Last <email@domain.tld>\"\n>> > e.g:\n>> > \t\"Reported-by: First Last <email@domain.tld>\" (no quotes are used)\n>> This is just a phrasing issue, but I am a bit reluctant about the name\n>> \"signature\".\n>\n> I've called all these markings signatures.\n> Maybe email-address-tags or another name could be used.\n> I'm not bothered one way or another by any chosen name.\n\nIt's been four years, but I recently ran into this. I mistakenly thought\nthat git would actually pick up cc addresses also from Reported-by, so\nthe reporter ended up not being cc'ed. Is there any chance this could be\nrevisited, or should I use a --cc-cmd to do what I want?\n\nRasmus\n"},{"id":"273913","messageId":"1449075602.3716.27.camel@perches.com","threadId":"27948","inReplyTo":"87mvtti2ul.fsf@rasmusvillemoes.dk","subject":"[PATCH V3] git-send-email: Add auto-cc to all body signatures","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2015-12-02T17:00:02Z","receivedAt":"2015-12-02T17:00:02Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"Many types of signatures are used by various projects.\n\nThe most common type is formatted:\n\t\"[some_signature_type]-by: First Last <email <at> domain.tld>\"\ne.g:\n\t\"Reported-by: First Last <email <at> domain.tld>\" (no quotes are used)\n\nMake git-send-email use these signatures as \"CC:\" entries.\n\nAdd command line option --suppress-cc=signatures to avoid\nadding these entries to the cc.\n\nSigned-off-by: Joe Perches <joe <at> perches.com>\nAcked-by: Jeff Kirsher <jeffrey.t.kirsher <at> intel.com>\n---\n> It's been four years, but I recently ran into this. I mistakenly thought\n> that git would actually pick up cc addresses also from Reported-by, so\n> the reporter ended up not being cc'ed. Is there any chance this could be\n> revisited,\n\nHere's a refresh if desired.  I still think it's sensible.\n\n Documentation/git-send-email.txt |  3 ++-\n git-send-email.perl              | 11 ++++++-----\n 2 files changed, 8 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex b9134d2..0866ae2 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -306,8 +306,9 @@ 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+- 'signatures' will avoid including anyone mentioned in any \"<foo>-by:\" lines.\n - 'cccmd' will avoid running the --cc-cmd.\n-- 'body' is equivalent to 'sob' + 'bodycc'\n+- 'body' is equivalent to 'sob' + 'bodycc' + 'signatures'\n - 'all' will suppress all auto cc values.\n --\n +\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e907e0ea..536e264 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -83,7 +83,7 @@ git send-email [options] <file | directory | rev-list options >\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, cccmd, body, bodycc, signatures, 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@@ -421,13 +421,13 @@ 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|body|bodycc)$/;\n+\t\t\tunless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc|signatures)$/;\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 (cccmd cc author self sob body bodycc signatures)) {\n \t\t$suppress_cc{$entry} = 1;\n \t}\n \tdelete $suppress_cc{'all'};\n@@ -438,7 +438,7 @@ $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+\tforeach my $entry (qw (sob bodycc signatures)) {\n \t\t$suppress_cc{$entry} = 1;\n \t}\n \tdelete $suppress_cc{'body'};\n@@ -1516,7 +1516,7 @@ foreach my $t (@files) {\n \t# Now parse the message body\n \twhile(<$fh>) {\n \t\t$message .=  $_;\n-\t\tif (/^(Signed-off-by|Cc): (.*)$/i) {\n+\t\tif (/^(Signed-off-by|Cc|[^\\s]+[_-]by): (.*)$/i) {\n \t\t\tchomp;\n \t\t\tmy ($what, $c) = ($1, $2);\n \t\t\tchomp $c;\n@@ -1526,6 +1526,7 @@ foreach my $t (@files) {\n \t\t\t} else {\n \t\t\t\tnext if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;\n \t\t\t\tnext if $suppress_cc{'bodycc'} and $what =~ /Cc/i;\n+\t\t\t\tnext if $suppress_cc{'signatures'} and $what =~ /by$/i;\n \t\t\t}\n \t\t\tpush @cc, $c;\n \t\t\tprintf(\"(body) Adding cc: %s from line '%s'\\n\",\n"},{"id":"273917","messageId":"xmqq8u5c68by.fsf@gitster.mtv.corp.google.com","threadId":"27948","inReplyTo":"1449075602.3716.27.camel@perches.com","subject":"Re: [PATCH V3] git-send-email: Add auto-cc to all body signatures","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-02T17:58:41Z","receivedAt":"2015-12-02T17:58:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Joe Perches <joe@perches.com> writes:\n\n> Many types of signatures are used by various projects.\n>\n> The most common type is formatted:\n> \t\"[some_signature_type]-by: First Last <email <at> domain.tld>\"\n> e.g:\n> \t\"Reported-by: First Last <email <at> domain.tld>\" (no quotes are used)\n>\n> Make git-send-email use these signatures as \"CC:\" entries.\n>\n> Add command line option --suppress-cc=signatures to avoid\n> adding these entries to the cc.\n>\n> Signed-off-by: Joe Perches <joe <at> perches.com>\n> Acked-by: Jeff Kirsher <jeffrey.t.kirsher <at> intel.com>\n\nI wonder what send-email with this patch does to the above two lines\nwith \"<at>\" not \"@\" ;-)  How was this patch sent?\n\nIn any case, did you mean \"Helped-by:\" not \"Acked-by:\"?  \"git\nshortlog git-send-email.perl\" does not show that name as one of the\nmajor stakeholders who would be capable of giving an Ack on it.\n\n> ---\n>> It's been four years, but I recently ran into this. I mistakenly thought\n>> that git would actually pick up cc addresses also from Reported-by, so\n>> the reporter ended up not being cc'ed. Is there any chance this could be\n>> revisited,\n>\n> Here's a refresh if desired.  I still think it's sensible.\n\nWhat the patch tries to achieve may make a lot of sense.  I however\ndo not necessarily think this particular implementation does,\nunfortunately.\n\nThese \"Random-by:\", especially the ones that the author adds on his\nown initiative like \"Reported-by:\", are often followed by just a\nname but not an addresses.  A \"Signed-off-by:\" and \"Cc:\" that is not\nfollowed by a valid e-mail address may deserve to get an error (or\nperhaps an end-user interaction \"This is not a valid address. What\ndo you want to do about it?\") so \"/^(Signed-off-by|Cc): (.*)$/i\"\ndoes not need its own sanity check on $2, because a later call to\nextract-valid-address or extract-valid-address-or-die will take care\nof it.\n\nIt would however be wrong to cause the program to error out or even\nbother the user upon seeing such random trailer lines that the\nauthor did not mean to have an e-mail address on it in the first\nplace.  If you have a trailer line\n\n    Random-by: Joe Perches\n\nwithout an address, I suspect you will end up adding \"Joe\" and\n\"Perches\" as two addresses on the Cc: line, which is most likely not\nwhat the user intended [*1*].\n\nAs to the lingo, these are still not signatures, but during the past\nyears, it seems that we settled on using the term \"trailers\" for\nthese e-mail header-like things at the end of the log message.\n\"Trailers\" are not limited to \"*-by:\" so this patch is not about\nadding auto-cc to all trailers--a retitle would be\n\n    send-email: add auto-cc to addresses that appear on *-by: trailers\n\nor something (and the option and variable names may need to be\nupdated to match).\n\n\n[Footnote]\n\n*1* I further suspect that the existing code shares a similar issue.\nDon't Cc: and Signed-off-by: expect a single address on each line in\nthe usual fashion?  Perhaps a two-patch series whose first part does\n\n-\t\tif (/^(Signed-off-by|Cc): (.*)$/i) {\n+\t\tif (/^(Signed-off-by|Cc): (.*<[^>]*>)\\s*$/i) {\n\nto tighten it (so that \"Cc: Joe Perches\" would not result in two\npieces of mail sent to Joe and Perches), with your patch as a follow\nup, may be a good way forward.\n\nI dunno.\n"},{"id":"273919","messageId":"1449080450.3716.44.camel@perches.com","threadId":"27948","inReplyTo":"xmqq8u5c68by.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH V3] git-send-email: Add auto-cc to all body signatures","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2015-12-02T18:20:50Z","receivedAt":"2015-12-02T18:20:50Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Wed, 2015-12-02 at 09:58 -0800, Junio C Hamano wrote:\n> Joe Perches <joe@perches.com> writes:\n> \n> > Many types of signatures are used by various projects.\n> > \n> > The most common type is formatted:\n> > \t\"[some_signature_type]-by: First Last <email <at> domain.tld>\"\n> > e.g:\n> > \t\"Reported-by: First Last <email <at> domain.tld>\" (no quotes are used)\n> > \n> > Make git-send-email use these signatures as \"CC:\" entries.\n> > \n> > Add command line option --suppress-cc=signatures to avoid\n> > adding these entries to the cc.\n> > \n> > Signed-off-by: Joe Perches  perches.com>\n> > Acked-by: Jeff Kirsher  intel.com>\n> \n> I wonder what send-email with this patch does to the above two lines\n> with \"\" not \"@\" ;-)  How was this patch sent?\n\ngnome evolution v3.18.2 email client.\n\nAnd it seems all newer versions of evolution beyond 3.12\nare really, really poor at sending inline patches. <grumble>\n\nI'll update and resend using git-send-email eventually\n\n> In any case, did you mean \"Helped-by:\" not \"Acked-by:\"?  \"git\n> shortlog git-send-email.perl\" does not show that name as one of the\n> major stakeholders who would be capable of giving an Ack on it.\n\nAt least for linux-kernel, \"Acked-by:\" doesn't mean a maintainer\nor a contributor to a particular module/file, just someone that\nhas looked at the patch, tried it, and approved of the concept.\n\nI don't know what process git uses for approval/signatures.\n\n> > ---\n> > > It's been four years, but I recently ran into this. I mistakenly thought\n> > > that git would actually pick up cc addresses also from Reported-by, so\n> > > the reporter ended up not being cc'ed. Is there any chance this could be\n> > > revisited,\n> > \n> > Here's a refresh if desired.  I still think it's sensible.\n> \n> What the patch tries to achieve may make a lot of sense.  I however\n> do not necessarily think this particular implementation does,\n> unfortunately.\n> \n> These \"Random-by:\", especially the ones that the author adds on his\n> own initiative like \"Reported-by:\", are often followed by just a\n> name but not an addresses.  A \"Signed-off-by:\" and \"Cc:\" that is not\n> followed by a valid e-mail address may deserve to get an error (or\n> perhaps an end-user interaction \"This is not a valid address. What\n> do you want to do about it?\") so \"/^(Signed-off-by|Cc): (.*)$/i\"\n> does not need its own sanity check on $2, because a later call to\n> extract-valid-address or extract-valid-address-or-die will take care\n> of it.\n\n> It would however be wrong to cause the program to error out or even\n> bother the user upon seeing such random trailer lines that the\n> author did not mean to have an e-mail address on it in the first\n> place.  If you have a trailer line\n> \n>     Random-by: Joe Perches\n> \n> without an address, I suspect you will end up adding \"Joe\" and\n> \"Perches\" as two addresses on the Cc: line, which is most likely not\n> what the user intended [*1*].\n\nAt least with new versions of git-send-email.perl\nthat's true so the patch will need to validate that\nthere is an email address following.\n\n> As to the lingo, these are still not signatures, but during the past\n> years, it seems that we settled on using the term \"trailers\" for\n> these e-mail header-like things at the end of the log message.\n> \"Trailers\" are not limited to \"*-by:\" so this patch is not about\n> adding auto-cc to all trailers--a retitle would be\n> \n>     send-email: add auto-cc to addresses that appear on *-by: trailers\n> \n> or something (and the option and variable names may need to be\n> updated to match).\n> \n> \n> [Footnote]\n> \n> *1* I further suspect that the existing code shares a similar issue.\n> Don't Cc: and Signed-off-by: expect a single address on each line in\n> the usual fashion?  Perhaps a two-patch series whose first part does\n> \n> -\t\tif (/^(Signed-off-by|Cc): (.*)$/i) {\n> +\t\tif (/^(Signed-off-by|Cc): (.*<[^>]*>)\\s*$/i) {\n> \n> to tighten it (so that \"Cc: Joe Perches\" would not result in two\n> pieces of mail sent to Joe and Perches), with your patch as a follow\n> up, may be a good way forward.\n> \n> I dunno.\n\nI believe the old git-send-email code required addresses\nand validated the form after Signed-off-by:'s.\n\nI haven't looked at the code for several years and just\nrefreshed it without much thinking or testing.\n\nI'll do a bit more and resend.\n"},{"id":"273921","messageId":"1449080938.3716.45.camel@perches.com","threadId":"27948","inReplyTo":"xmqq8u5c68by.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH V3] git-send-email: Add auto-cc to all body signatures","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2015-12-02T18:28:58Z","receivedAt":"2015-12-02T18:28:58Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Wed, 2015-12-02 at 09:58 -0800, Junio C Hamano wrote:\n> \"Trailers\" are not limited to \"*-by:\"\n\nbtw:  what are \"Trailers\" limited by?\n"}]}