@matheusbsbs / matheus-bagliano / commits / 79ee555bac
Fork 0

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>

Eric W. Biederman committed Jun 21, 2006 at 07:17 UTC 79ee555bac7a5ff846c8a381792bbe93cdffbf97
2 files changed +23
Documentation/git-send-email.txt
+9
@@ -24,9 +24,16 @@ OPTIONS
24 -------
25 The options available are:
26
27 +--bcc::
28 + Specify a "Bcc:" value for each email.
29 +
30 + The --bcc option must be repeated for each user you want on the bcc list.
31 +
32 --cc::
33 Specify a starting "Cc:" value for each email.
34
35 + The --cc option must be repeated for each user you want on the cc list.
36 +
37 --chain-reply-to, --no-chain-reply-to::
38 If this is set, each email will be sent as a reply to the previous
39 email sent. If disabled with "--no-chain-reply-to", all emails after
@@ -76,6 +83,8 @@ The options available are:
83 Generally, this will be the upstream maintainer of the
84 project involved.
85
86 + The --to option must be repeated for each user you want on the to list.
87 +
88
89 Author
90 ------
git-send-email.perl
+14
@@ -65,6 +65,20 @@ my $rc = GetOptions("from=s" => \$from,
65 "no-signed-off-cc|no-signed-off-by-cc" => \$no_signed_off_cc,
66 );
67
68 +# Verify the user input
69 +
70 +foreach my $entry (@to) {
71 + die "Comma in --to entry: $entry'\n" unless $entry !~ m/,/;
72 +}
73 +
74 +foreach my $entry (@initial_cc) {
75 + die "Comma in --cc entry: $entry'\n" unless $entry !~ m/,/;
76 +}
77 +
78 +foreach my $entry (@bcclist) {
79 + die "Comma in --bcclist entry: $entry'\n" unless $entry !~ m/,/;
80 +}
81 +
82 # Now, let's fill any that aren't set in with defaults:
83
84 sub gitvar {