Skip to content

Commit

Permalink
Merge branch 'jh/send-email-one-cc'
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
gitster committed Mar 10, 2017
2 parents fc32293 + 9d33439 commit ea1e784
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions t/t9001-send-email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ cat >expected-cc <<\EOF
!two@example.com!
!three@example.com!
!four@example.com!
!five@example.com!
EOF
"

Expand All @@ -159,9 +158,9 @@ test_expect_success $PREREQ 'cc trailer with various syntax' '
Test Cc: trailers.
Cc: one@example.com
Cc: <two@example.com> # this is part of the name
Cc: <three@example.com>, <four@example.com> # not.five@example.com
Cc: "Some # Body" <five@example.com> [part.of.name.too]
Cc: <two@example.com> # trailing comments are ignored
Cc: <three@example.com>, <not.four@example.com> one address per line
Cc: "Some # Body" <four@example.com> [ <also.a.comment> ]
EOF
clean_fake_sendmail &&
git send-email -1 --to=recipient@example.com \
Expand Down

0 comments on commit ea1e784

Please sign in to comment.