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

Re: [PATCH 3/3] send-email: also pick up cc addresses from -by trailers

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 11, 2018, 06:18 UTC
Message-ID
<xmqqd0shgg66.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20181010111351.5045-4-rv@rasmusvillemoes.dk>
Rasmus Villemoes <rv@rasmusvillemoes.dk> writes:
Show 6 quoted lines
> @@ -1681,7 +1681,7 @@ sub process_file {
>  	# Now parse the message body
>  	while(<$fh>) {
>  		$message .=  $_;
> -		if (/^(Signed-off-by|Cc): (.*)/i) {
> +		if (/^([a-z-]*-by|Cc): (.*)/i) {
So this picks up anything-by not just s-o-by, which sort of makes sense.
Show 5 quoted lines
> @@ -1691,7 +1691,9 @@ sub process_file {
>  			if ($sc eq $sender) {
>  				next if ($suppress_cc{'self'});
>  			} else {
> -				next if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;

We used to only grab CC or Signed-off-by (and specifically not something like "Not-Signed-off-by") upfront above, so matching /Signed-off-by/ was sufficient (it would have been sufficient to just look for 's'). But to suppress s-o-b and keep allowing via misc-by a trailer "Not-signed-off-by:", we now ...

> +				next if $suppress_cc{'sob'} and $what =~ /^Signed-off-by$/i;

... must make sure what we have is _exactly_ "signed-off-by" when 'sob' is suppressed. Makes sense.

> +				next if $suppress_cc{'misc-by'}
> +					and $what =~ /-by$/i and $what !~ /^Signed-off-by$/i;
And this is the opposite side of the same coin, which also makes sense.

I wonder if it would make it easier to grok if we made the logic inside out, i.e.

	if ($sc eq $sender) {
		...
	} else {
		if ($what =~ /^Signed-off-by$/i) {
			next if $suppress_cc{'sob'};
		} elsif ($what =~ /-by$/i) {
			next if $suppress_cc{'misc'};
		} elsif ($what =~ /^Cc$/i) {
			next if $suppress_cc{'bodycc'};
		}
		push @cc, $c;
		...
	}
>  				next if $suppress_cc{'bodycc'} and $what =~ /Cc/i;
>  			}
>  			if ($c !~ /.+@.+|<.+>/) {
Previous: Ævar Arnfjörð BjarmasonNext: Rasmus Villemoes
Message 11 of 20 in “send-email: Also pick up cc addresses from -by trailers”
  1. 0/3 send-email: Also pick up cc addresses from -by trailersRasmus Villemoes, Oct 10, 2018
  2. 1/3 Documentation/git-send-email.txt: style fixesRasmus Villemoes, Oct 10, 2018
  3. 2/3 send-email: only consider lines containing @ or <> for automatic Cc'ingRasmus Villemoes, Oct 10, 2018
  4. Ævar Arnfjörð BjarmasonOct 10, 2018
  5. Rasmus VillemoesOct 10, 2018
  6. Junio C HamanoOct 11, 2018
  7. Rasmus VillemoesOct 11, 2018
  8. Junio C HamanoOct 11, 2018
  9. 3/3 send-email: also pick up cc addresses from -by trailersRasmus Villemoes, Oct 10, 2018
  10. Ævar Arnfjörð BjarmasonOct 10, 2018
  11. Junio C HamanoOct 11, 2018
  12. Rasmus VillemoesOct 11, 2018
  13. Junio C HamanoOct 16, 2018
  14. Rasmus VillemoesOct 16, 2018
  15. Junio C HamanoOct 16, 2018
  16. 0/3 send-email: Also pick up cc addresses from -by trailersRasmus Villemoes, Oct 16, 2018
  17. 1/3 Documentation/git-send-email.txt: style fixesRasmus Villemoes, Oct 16, 2018
  18. 2/3 send-email: only consider lines containing @ or <> for automatic Cc'ingRasmus Villemoes, Oct 16, 2018
  19. 3/3 send-email: also pick up cc addresses from -by trailersRasmus Villemoes, Oct 16, 2018
  20. Junio C HamanoOct 16, 2018

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.