git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/6] send-email: fix suppress-cc=self on cccmd

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 3, 2013, 15:58 UTC
Message-ID
<7v7gibjieh.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1369897638-27299-3-git-send-email-mst@redhat.com>
"Michael S. Tsirkin" <mst@redhat.com> writes:
Show 19 quoted lines
> When cccmd is used, old-style suppress-from filter
> is applied by the newer suppress-cc=self isn't.
> Fix this up.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  git-send-email.perl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index bd13cc8..a138615 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -1462,7 +1462,7 @@ sub recipients_cmd {
>  		$address =~ s/^\s*//g;
>  		$address =~ s/\s*$//g;
>  		$address = sanitize_address($address);
> -		next if ($address eq $sanitized_sender and $suppress_from);
> +		next if ($address eq $sender and $suppress_cc{'self'});

If $suppress_from is defined, $suppress_cc{'self'} gets its value, so the latter half of this change is very understandable.

The original comparison uses $address that is "sanitized" (whose definition is roughly "mangled/quoted with rfc2047 etc to fit on To/Cc headers") against $sanitized_sender, which means for a

    $sender = 'Michael S. Tsirkin <mst@redhat.com>';
we used
    $sanitized_sender = '"Michael S. Tsirkin" <mst@redhat.com>';

for comparison, but the new code does not quote the $recipient_name part inside dq for the single dot after the middle name. Is this a desirable change?

>  		push @addresses, $address;
>  		printf("($prefix) Adding %s: %s from: '%s'\n",
>  		       $what, $address, $cmd) unless $quiet;
Previous: Michael S. TsirkinNext: Michael S. Tsirkin
Message 5 of 18 in “git send-email suppress-cc=self fixes”
  1. 0/6 git send-email suppress-cc=self fixesMichael S. Tsirkin, May 30, 2013
  2. 1/6 t/send-email.sh: add test for suppress-cc=selfMichael S. Tsirkin, May 30, 2013
  3. Junio C HamanoJun 3, 2013
  4. 2/6 send-email: fix suppress-cc=self on cccmdMichael S. Tsirkin, May 30, 2013
  5. Junio C HamanoJun 3, 2013
  6. Michael S. TsirkinJun 3, 2013
  7. Junio C HamanoJun 3, 2013
  8. Michael S. TsirkinJun 3, 2013
  9. Junio C HamanoJun 3, 2013
  10. 3/6 t/send-email: test suppress-cc=self on cccmdMichael S. Tsirkin, May 30, 2013
  11. 4/6 send-email: make --suppress-cc=self sanitize inputMichael S. Tsirkin, May 30, 2013
  12. Junio C HamanoJun 3, 2013
  13. Michael S. TsirkinJun 3, 2013
  14. Junio C HamanoJun 3, 2013
  15. 5/6 t/send-email: add test with quoted senderMichael S. Tsirkin, May 30, 2013
  16. 6/6 t/send-email: test suppress-cc=self with non-asciiMichael S. Tsirkin, May 30, 2013
  17. Junio C HamanoJun 3, 2013
  18. Michael S. TsirkinJun 3, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.