{"thread":{"id":"10699","subject":"[PATCH] send-email: apply --suppress-from to S-o-b and cc-cmd","startedAt":"2007-11-07T07:34:12Z","lastAt":"2007-11-07T20:43:16Z","messageCount":2,"participants":["Uwe Kleine-König","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"58638","messageId":"1194420852-15822-1-git-send-email-ukleinek@informatik.uni-freiburg.de","threadId":"10699","inReplyTo":null,"subject":"[PATCH] send-email: apply --suppress-from to S-o-b and cc-cmd","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-11-07T07:34:12Z","receivedAt":"2007-11-07T07:34:12Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"From: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>\n\nSigned-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>\nCc: Ryan Anderson <ryan@michonline.com>\n---\nHello,\n\nI don't see the sense in adding the sender to Cc: from Signed-off-by\nlines but not from From:.  If someone is convinced it makes sense, I'm\nwilling to send a new patch that uses a different option.\n\nCc'd Ryan as the author of --suppress-from.\n\nI already tried to send this from my work's email account, but it seems\nto have problems to send mails to vger (and lists.arm.linux.org.uk).\nSorry Ryan if you get this mail once more.\n\nBest regards\nUwe\n\n Documentation/git-send-email.txt |    3 +--\n git-send-email.perl              |    5 +++--\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex e38b702..659215a 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -113,8 +113,7 @@ The --cc option must be repeated for each user you want on the cc list.\n \tis not set, this will be prompted for.\n \n --suppress-from, --no-suppress-from::\n-        If this is set, do not add the From: address to the cc: list, if it\n-        shows up in a From: line.\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 \ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 96051bc..f4b8f96 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -88,8 +88,7 @@ Options:\n \n    --smtp-ssl     If set, connects to the SMTP server using SSL.\n \n-   --suppress-from Suppress sending emails to yourself if your address\n-                  appears in a From: line. Defaults to off.\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                   emails. Defaults to on.\n@@ -730,6 +729,7 @@ foreach my $t (@files) {\n \t\t\tif (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) {\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\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@@ -745,6 +745,7 @@ foreach my $t (@files) {\n \t\t\tmy $c = $_;\n \t\t\t$c =~ s/^\\s*//g;\n \t\t\t$c =~ s/\\n$//g;\n+\t\t\tnext if ($c eq $sender and $suppress_from);\n \t\t\tpush @cc, $c;\n \t\t\tprintf(\"(cc-cmd) Adding cc: %s from: '%s'\\n\",\n \t\t\t\t$c, $cc_cmd) unless $quiet;\n-- \n1.5.3.4\n"},{"id":"58720","messageId":"7vode5aisb.fsf@gitster.siamese.dyndns.org","threadId":"10699","inReplyTo":"1194420852-15822-1-git-send-email-ukleinek@informatik.uni-freiburg.de","subject":"Re: [PATCH] send-email: apply --suppress-from to S-o-b and cc-cmd","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-07T20:43:16Z","receivedAt":"2007-11-07T20:43:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Uwe Kleine-König  <ukleinek@informatik.uni-freiburg.de> writes:\n\n> From: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>\n>\n> Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>\n> Cc: Ryan Anderson <ryan@michonline.com>\n> ---\n> Hello,\n>\n> I don't see the sense in adding the sender to Cc: from Signed-off-by\n> lines but not from From:.  If someone is convinced it makes sense, I'm\n> willing to send a new patch that uses a different option.\n\nI _think_ --suppress-from just means \"I know what I'll be\nsending out, so do not bother my mailbox with a copy of this\nmessage\", so what the patch tries to do makes perfect sense to\nme.\n\n> @@ -730,6 +729,7 @@ foreach my $t (@files) {\n>  \t\t\tif (/^(Signed-off-by|Cc): (.*)$/i && $signed_off_cc) {\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\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> @@ -745,6 +745,7 @@ foreach my $t (@files) {\n>  \t\t\tmy $c = $_;\n>  \t\t\t$c =~ s/^\\s*//g;\n>  \t\t\t$c =~ s/\\n$//g;\n> +\t\t\tnext if ($c eq $sender and $suppress_from);\n>  \t\t\tpush @cc, $c;\n>  \t\t\tprintf(\"(cc-cmd) Adding cc: %s from: '%s'\\n\",\n>  \t\t\t\t$c, $cc_cmd) unless $quiet;\n\nBy the way, I noticed that in the header part we pick CC: and\nFrom: address, which are rfc2047 quoted, and unquote it to\ncompare with the sender.  If they are different, we push the\naddress, still rfc2047 quoted, to @cc, like this:\n\n\t} elsif (/^(Cc|From):\\s+(.*)$/) {\n\t\tif (unquote_rfc2047($2) eq $sender) {\n\t\t\tnext if ($suppress_from);\n\t\t}\n\t\telsif ($1 eq 'From') {\n\t\t\t$author = unquote_rfc2047($2);\n\t\t}\n\t\tprintf(\"(mbox) Adding cc: %s from line '%s'\\n\",\n\t\t\t$2, $_) unless $quiet;\n\t\tpush @cc, $2;\n\t}\n\nHowever, in the body part, when we see S-o-b: and CC: address,\nwhich are _not_ rfc2047 quoted, do not unquote to compare with\n$sender and we push it direct to @cc (the original text in the\nfirst hunk of your patch).  We do the same for output from\n$cc_cmd if specified (the second hunk).\n\nThis means that @cc list would be a mixed bag.  Some are rfc2047\nquoted, and some are not.  This inconsistency of course is taken\ncare of by the call to sanitize_address over @cc at the very\nbeginning of send_message(), but it somehow feels dirty.\n"}]}