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

Re: [PATCH] git-send-email.perl: Add --suppress-to

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2011, 20:28 UTC
Message-ID
<7vr5bkx606.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1296949208.4133.66.camel@Joe-Laptop>
Joe Perches <joe@perches.com> writes:
Show 6 quoted lines
> +- 'author' will avoid including the patch author
> +- 'self' will avoid including the sender
> +- 'tocmd' will avoid running the --to-cmd
> +- 'bodyto' will avoid including anyone mentioned in To lines in the
> +   patch body (commit message) except for self (use 'self' for that)
> +- 'all' will suppress all auto to values.

Is there a definition of what an "auto to value" is somewhere? "auto cc values" was sort of understandable as there is no word "cc" (other than 1/1000 litre ;-) and what it meant was guessable from context, but it took me a few seconds to realize you meant "To:" with this.

Show 9 quoted lines
> +--
> ++
> +Default is the value of 'sendemail.suppressto' configuration value; if
> +that is unspecified, default to 'self' if --suppress-from is
> +specified.
> +
>  --suppress-cc=<category>::
>  	Specify an additional category of recipients to suppress the
>  	auto-cc of:
Hmmm, from a cursory look I don't see how bodyto is handled and where.
Show 6 quoted lines
> @@ -1201,6 +1227,9 @@ foreach my $t (@files) {
>  			}
>  			elsif (/^To:\s+(.*)$/) {
>  				foreach my $addr (parse_address_line($1)) {
> +
> +				    next if $suppress_to{'author'};
Is "To: somebody" in the output guaranteed to name the author and nobody else?
> +				    next if $suppress_to{'self'} and $author eq $sender;
>  					printf("(mbox) Adding to: %s from line '%s'\n",
>  						$addr, $_) unless $quiet;
>  					push @to, sanitize_address($addr);
Show 8 quoted lines
> @@ -1269,7 +1298,7 @@ foreach my $t (@files) {
>  	close $fh;
>  
>  	push @to, recipients_cmd("to-cmd", "to", $to_cmd, $t)
> -		if defined $to_cmd;
> +		if defined $to_cmd && !$suppress_to{'tocmd'};
>  	push @cc, recipients_cmd("cc-cmd", "cc", $cc_cmd, $t)
>  		if defined $cc_cmd && !$suppress_cc{'cccmd'};

I think it is about time to make this a bit more readable by explicitly using if statement, not statement modifiers.

Previous: Joe PerchesNext: Andreas Schwab
Message 11 of 13 in “git-send-email.perl: Deduplicate "to:" and "cc:" entries with names”
  1. git-send-email.perl: Deduplicate "to:" and "cc:" entries with namesJoe Perches, Nov 20, 2010
  2. Andreas SchwabNov 20, 2010
  3. Joe PerchesNov 20, 2010
  4. Pete HarlanNov 20, 2010
  5. git-send-email.perl: Deduplicate "to:" and "cc:" entries with namesJoe Perches, Nov 20, 2010
  6. Junio C HamanoNov 26, 2010
  7. Joe PerchesNov 26, 2010
  8. Junio C HamanoNov 27, 2010
  9. Joe PerchesNov 27, 2010
  10. git-send-email.perl: Add --suppress-toJoe Perches, Feb 5, 2011
  11. Junio C HamanoFeb 6, 2011
  12. Andreas SchwabNov 20, 2010
  13. Joe PerchesNov 20, 2010

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.