aboutsummaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2006-06-21 07:17:31 -0600
committerJunio C Hamano <junkio@cox.net>2006-06-22 00:20:20 -0700
commit79ee555bac7a5ff846c8a381792bbe93cdffbf97 (patch)
tree5f863d69722c7e0b967abbc574880d642447135d /git-send-email.perl
parentc1f8064b143f98e8b3c5ff1ce12ebd0800df5d67 (diff)
downloadgit-79ee555bac7a5ff846c8a381792bbe93cdffbf97.tar.gz
git-79ee555bac7a5ff846c8a381792bbe93cdffbf97.tar.xz
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>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl14
1 files changed, 14 insertions, 0 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 7b1cca70a..c5d9e7335 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -65,6 +65,20 @@ my $rc = GetOptions("from=s" => \$from,
"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 {