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

Re: [PATCH v2] send-email: only allow one address per body tag

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Feb 20, 2017, 12:10 UTC
Message-ID
<vpqo9xxkqqo.fsf@anie.imag.fr>
In-Reply-To
<20170220114406.19436-1-johan@kernel.org>
Johan Hovold <johan@kernel.org> writes:
Show 8 quoted lines
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -1563,7 +1563,7 @@ foreach my $t (@files) {
>  	# Now parse the message body
>  	while(<$fh>) {
>  		$message .=  $_;
> -		if (/^(Signed-off-by|Cc): (.*)$/i) {
> +		if (/^(Signed-off-by|Cc): ([^>]*>?)/i) {
I think this is acceptable, but this doesn't work with trailers like
Cc: "Some > Body" <Some.Body@example.com>

A proper management of this kind of weird address should be doable by reusing the regexp parsing "..." in parse_mailbox:

	my $re_quote = qr/"(?:[^\"\\]|\\.)*"/;
So the final regex would look like
if (/^(Signed-off-by|Cc): (([^>]*|"(?:[^\"\\]|\\.)*")>?)/i) {

I don't think that should block the patch inclusion, but it may be worth considering.

Anyway, thanks for the patch!
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Johan HovoldNext: Junio C Hamano
Message 19 of 22 in “body-CC-comment regression”
  1. Johan HovoldFeb 16, 2017
  2. Junio C HamanoFeb 16, 2017
  3. Johan HovoldFeb 16, 2017
  4. Matthieu MoyFeb 16, 2017
  5. Johan HovoldFeb 17, 2017
  6. Matthieu MoyFeb 17, 2017
  7. Johan HovoldFeb 17, 2017
  8. Matthieu MoyFeb 17, 2017
  9. Johan HovoldFeb 17, 2017
  10. Junio C HamanoFeb 17, 2017
  11. Johan HovoldFeb 17, 2017
  12. Junio C HamanoFeb 17, 2017
  13. Matthieu MoyFeb 17, 2017
  14. Junio C HamanoFeb 17, 2017
  15. Matthieu MoyFeb 17, 2017
  16. Junio C HamanoFeb 17, 2017
  17. Junio C HamanoFeb 17, 2017
  18. send-email: only allow one address per body tagJohan Hovold, Feb 20, 2017
  19. Matthieu MoyFeb 20, 2017
  20. Junio C HamanoFeb 23, 2017
  21. Matthieu MoyFeb 26, 2017
  22. Linus TorvaldsFeb 17, 2017

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.