Skip to content

Commit 71da2fb

Browse files
committed
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
2 parents 7e02ec2 + 9d33439 commit 71da2fb

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

git-send-email.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,7 +1563,7 @@ sub send_message {
15631563
# Now parse the message body
15641564
while(<$fh>) {
15651565
$message .= $_;
1566-
if (/^(Signed-off-by|Cc): (.*)$/i) {
1566+
if (/^(Signed-off-by|Cc): ([^>]*>?)/i) {
15671567
chomp;
15681568
my ($what, $c) = ($1, $2);
15691569
chomp $c;

t/t9001-send-email.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ cat >expected-cc <<\EOF
148148
149149
150150
151-
152151
EOF
153152
"
154153

@@ -159,9 +158,9 @@ test_expect_success $PREREQ 'cc trailer with various syntax' '
159158
Test Cc: trailers.
160159
161160
162-
Cc: <[email protected]> # this is part of the name
163-
164-
Cc: "Some # Body" <five@example.com> [part.of.name.too]
161+
Cc: <[email protected]> # trailing comments are ignored
162+
Cc: <[email protected]>, <not.[email protected]> one address per line
163+
Cc: "Some # Body" <four@example.com> [ <also.a.comment> ]
165164
EOF
166165
clean_fake_sendmail &&
167166
git send-email -1 [email protected] \

0 commit comments

Comments
 (0)