Commits

Anonymous committed 79ee555

Check and document the options to prevent mistakes.

When multiple recipients are given to git-send-email on the same
--cc line the code does not properly handle it.

Full and proper parsing of the email addresses so I can detect
which commas mean a new email address is more than I care to implement.

In particular this email address: "bibo,mao" <bibo.mao@intel.com>
must not be treated as two email addresses.

So this patch simply treats all commas in recipient lists as
an error and fails if one is given.

At the same time it documents that git-send-email wants multiple
instances of --cc specified on the command line if you want to
cc multiple recipients.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>

Comments (0)

Files changed (2)

Documentation/git-send-email.txt

 -------
 The options available are:
 
+--bcc::
+	Specify a "Bcc:" value for each email.
+
+	The --bcc option must be repeated for each user you want on the bcc list.
+
 --cc::
 	Specify a starting "Cc:" value for each email.
 
+	The --cc option must be repeated for each user you want on the cc list.
+
 --chain-reply-to, --no-chain-reply-to::
 	If this is set, each email will be sent as a reply to the previous
 	email sent.  If disabled with "--no-chain-reply-to", all emails after
 	Generally, this will be the upstream maintainer of the
 	project involved.
 
+	The --to option must be repeated for each user you want on the to list.
+
 
 Author
 ------

git-send-email.perl

 		    "no-signed-off-cc|no-signed-off-by-cc" => \$no_signed_off_cc,
 	 );
 
+# Verify the user input
+
+foreach my $entry (@to) {
+	die "Comma in --to entry: $entry'\n" unless $entry !~ m/,/;
+}
+
+foreach my $entry (@initial_cc) {
+	die "Comma in --cc entry: $entry'\n" unless $entry !~ m/,/;
+}
+
+foreach my $entry (@bcclist) {
+	die "Comma in --bcclist entry: $entry'\n" unless $entry !~ m/,/;
+}
+
 # Now, let's fill any that aren't set in with defaults:
 
 sub gitvar {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.