From: Junio C Hamano Date: Tue, 21 Mar 2017 22:03:30 +0000 (-0700) Subject: Merge branch 'jh/send-email-one-cc' into maint X-Git-Tag: v2.12.2~11 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/71da2fb077c90d24f3d3b7597cea0393702ec467?hp=7e02ec2c5d2e54df0300e5035fbb952e8dcf302c Merge branch 'jh/send-email-one-cc' into maint "Cc:" on the trailer part does not have to conform to RFC strictly, unlike in the e-mail header. "git send-email" has been updated to ignore anything after '>' when picking addresses, to allow non-address cruft like " # stable 4.4" after the address. * jh/send-email-one-cc: send-email: only allow one address per body tag --- diff --git a/git-send-email.perl b/git-send-email.perl index 068d60b3e6..eea0a517f7 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -1563,7 +1563,7 @@ sub send_message { # Now parse the message body while(<$fh>) { $message .= $_; - if (/^(Signed-off-by|Cc): (.*)$/i) { + if (/^(Signed-off-by|Cc): ([^>]*>?)/i) { chomp; my ($what, $c) = ($1, $2); chomp $c; diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 0f398dd160..60a80f60b2 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -148,7 +148,6 @@ cat >expected-cc <<\EOF !two@example.com! !three@example.com! !four@example.com! -!five@example.com! EOF " @@ -159,9 +158,9 @@ test_expect_success $PREREQ 'cc trailer with various syntax' ' Test Cc: trailers. Cc: one@example.com - Cc: # this is part of the name - Cc: , # not.five@example.com - Cc: "Some # Body" [part.of.name.too] + Cc: # trailing comments are ignored + Cc: , one address per line + Cc: "Some # Body" [ ] EOF clean_fake_sendmail && git send-email -1 --to=recipient@example.com \