git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: changbin.du@gmail.com
To: gitster@pobox.com
Cc: git@vger.kernel.org, "Du, Changbin" <changbin.du@gmail.com>
Subject: [PATCH] send-email: use sanitized address for cc
Date: Wed,  7 Sep 2016 14:57:33 +0800	[thread overview]
Message-ID: <20160907065733.28467-1-changbin.du@gmail.com> (raw)

From: "Du, Changbin" <changbin.du@gmail.com>

Some username in the email address may include a ','. In this case,
we need quoting the username field so it will not be parsed as two
single addresses by Mail::Address->parse().

For example, my eamil address "Du, Changbin <changbin.du@gmail.com>"
can be parsed as two addresses "Du" and "Changbin <changbin.du@gmail.com>"
if username is not quoted. ("Du, Changbin" is a legal format of signature
in Chinese)

The sanitized address can be used because quote is added automactically.

Signed-off-by: Du, Changbin <changbin.du@gmail.com>
---
 git-send-email.perl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 6958785..6ec189e 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1554,9 +1554,9 @@ foreach my $t (@files) {
 				next if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;
 				next if $suppress_cc{'bodycc'} and $what =~ /Cc/i;
 			}
-			push @cc, $c;
+			push @cc, $sc;
 			printf("(body) Adding cc: %s from line '%s'\n",
-				$c, $_) unless $quiet;
+				$sc, $_) unless $quiet;
 		}
 	}
 	close $fh;
-- 
2.7.4


                 reply	other threads:[~2016-09-07  7:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160907065733.28467-1-changbin.du@gmail.com \
    --to=changbin.du@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).