{"thread":{"id":"4604","subject":"[PATCH] Check and document the options to prevent mistakes.","startedAt":"2006-06-21T13:17:31Z","lastAt":"2006-06-22T03:45:45Z","messageCount":4,"participants":["Eric W. Biederman","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22207","messageId":"m164iu8x78.fsf@ebiederm.dsl.xmission.com","threadId":"4604","inReplyTo":null,"subject":"[PATCH] Check and document the options to prevent mistakes.","fromName":"Eric W. Biederman","fromEmail":"ebiederm@xmission.com","sentAt":"2006-06-21T13:17:31Z","receivedAt":"2006-06-21T13:17:31Z","isPatch":true,"sender":{"key":"ebiederm@xmission.com","avatar":"https://avatars.githubusercontent.com/u/7477136?v=4"},"body":"\nWhen multiple recipients are given to git-send-email on the same\n--cc line the code does not properly handle it.\n\nFull and proper parsing of the email addresses so I can detect\nwhich commas mean a new email address is more than I care to implement.\n\nIn particular this email address: \"bibo,mao\" <bibo.mao@intel.com>\nmust not be treated as two email addresses.\n\nSo this patch simply treats all commas in recipient lists as\nan error and fails if one is given.\n\nAt the same time it documents that git-send-email wants multiple\ninstances of --cc specified on the command line if you want to\ncc multiple recipients.\n\nSigned-off-by: Eric W. Biederman <ebiederm@xmission.com>\n\n---\n\n Documentation/git-send-email.txt |    9 +++++++++\n git-send-email.perl              |   14 ++++++++++++++\n 2 files changed, 23 insertions(+)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex ad1b9cf..481b3f5 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -24,9 +24,16 @@ OPTIONS\n -------\n The options available are:\n \n+--bcc::\n+\tSpecify a \"Bcc:\" value for each email.\n+\n+\tThe --bcc option must be repeated for each user you want on the bcc list.\n+\n --cc::\n \tSpecify a starting \"Cc:\" value for each email.\n \n+\tThe --cc option must be repeated for each user you want on the cc list.\n+\n --chain-reply-to, --no-chain-reply-to::\n \tIf this is set, each email will be sent as a reply to the previous\n \temail sent.  If disabled with \"--no-chain-reply-to\", all emails after\n@@ -76,6 +83,8 @@ The options available are:\n \tGenerally, this will be the upstream maintainer of the\n \tproject involved.\n \n+\tThe --to option must be repeated for each user you want on the to list.\n+\n \n Author\n ------\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 7b1cca7..c5d9e73 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -65,6 +65,20 @@ my $rc = GetOptions(\"from=s\" => \\$from,\n \t\t    \"no-signed-off-cc|no-signed-off-by-cc\" => \\$no_signed_off_cc,\n \t );\n \n+# Verify the user input\n+\n+foreach my $entry (@to) {\n+\tdie \"Comma in --to entry: $entry'\\n\" unless $entry !~ m/,/;\n+}\n+\n+foreach my $entry (@initial_cc) {\n+\tdie \"Comma in --cc entry: $entry'\\n\" unless $entry !~ m/,/;\n+}\n+\n+foreach my $entry (@bcclist) {\n+\tdie \"Comma in --bcclist entry: $entry'\\n\" unless $entry !~ m/,/;\n+}\n+\n # Now, let's fill any that aren't set in with defaults:\n \n sub gitvar {\n"},{"id":"22224","messageId":"7vy7vqxmb7.fsf@assigned-by-dhcp.cox.net","threadId":"4604","inReplyTo":"m164iu8x78.fsf@ebiederm.dsl.xmission.com","subject":"Re: [PATCH] Check and document the options to prevent mistakes.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-21T20:53:32Z","receivedAt":"2006-06-21T20:53:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"ebiederm@xmission.com (Eric W. Biederman) writes:\n\n> +# Verify the user input\n> +\n> +foreach my $entry (@to) {\n> +\tdie \"Comma in --to entry: $entry'\\n\" unless $entry !~ m/,/;\n> +}\n> +\n\nPerhaps, avoiding double negation would be easier on the eyes.\n\n        die ... if $entry =~ /,/\n\nDoes it grok '\"Biederman, Eric W.\" <eb@xm.com>' some people seem\nto do properly, or do we care (I personally don't)?\n"},{"id":"22233","messageId":"m1irmt6gax.fsf@ebiederm.dsl.xmission.com","threadId":"4604","inReplyTo":"7vy7vqxmb7.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Check and document the options to prevent mistakes.","fromName":"Eric W. Biederman","fromEmail":"ebiederm@xmission.com","sentAt":"2006-06-22T03:05:26Z","receivedAt":"2006-06-22T03:05:26Z","isPatch":true,"sender":{"key":"ebiederm@xmission.com","avatar":"https://avatars.githubusercontent.com/u/7477136?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> ebiederm@xmission.com (Eric W. Biederman) writes:\n>\n>> +# Verify the user input\n>> +\n>> +foreach my $entry (@to) {\n>> +\tdie \"Comma in --to entry: $entry'\\n\" unless $entry !~ m/,/;\n>> +}\n>> +\n>\n> Perhaps, avoiding double negation would be easier on the eyes.\n>\n>         die ... if $entry =~ /,/\n\nSure double negation does get confusing.  I think I forgot about that\nlast if form.  My perl is rusty from disuse.  \n\n> Does it grok '\"Biederman, Eric W.\" <eb@xm.com>' some people seem\n> to do properly, or do we care (I personally don't)?\n\nNope.  If figure that is lesser of two evils.  If I could properly\ngrok that I would make it do things properly and parse a --cc\noption for multiple email addresses.\n\nI think you can still specify those interesting forms in an alias\nfile, like .mailrc.\n\nThe important thing is not to do a mailing and the discover your\nrecipients didn't get the email.\n\nEric\n"},{"id":"22234","messageId":"7v1wthyhsm.fsf@assigned-by-dhcp.cox.net","threadId":"4604","inReplyTo":"m1irmt6gax.fsf@ebiederm.dsl.xmission.com","subject":"Re: [PATCH] Check and document the options to prevent mistakes.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-22T03:45:45Z","receivedAt":"2006-06-22T03:45:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"ebiederm@xmission.com (Eric W. Biederman) writes:\n\n> Junio C Hamano <junkio@cox.net> writes:\n>\n>> Does it grok '\"Biederman, Eric W.\" <eb@xm.com>' some people seem\n>> to do properly, or do we care (I personally don't)?\n>\n> Nope.  If figure that is lesser of two evils.\n\nFair enough.\n"}]}