{"thread":{"id":"39481","subject":"[PATCH 1/2] t9001-send-email: create a function replacing variable fields","startedAt":"2015-06-01T14:14:01Z","lastAt":"2015-06-02T17:19:25Z","messageCount":7,"participants":["Remi Lespinet","Matthieu Moy","Junio C Hamano","Rémi Lespinet"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"262593","messageId":"1433168042-28269-1-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","threadId":"39481","inReplyTo":null,"subject":"[PATCH 1/2] t9001-send-email: create a function replacing variable fields","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-01T14:14:01Z","receivedAt":"2015-06-01T14:14:01Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Create a function which replaces Date, Message-Id and\nX-Mailer lines generated by git-send-email by a specific string\n\nDate:.*$       -> Date: DATE-STRING\nMessage-Id:.*$ -> Message-Id: MESSAGE-ID-STRING\nX-Mailer:.*$   -> X-Mailer: X-MAILER-STRING\n\nThis is a preparatory for the next commit which uses this\nfunction\n\nSigned-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n---\n t/t9001-send-email.sh | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex a3663da..71968ee 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -519,6 +519,12 @@ Result: OK\n EOF\n \"\n \n+replace_variable_fields () {\n+\tsed\t-e \"s/^\\(Date:\\).*/\\1 DATE-STRING/\" \\\n+\t\t-e \"s/^\\(Message-Id:\\).*/\\1 MESSAGE-ID-STRING/\" \\\n+\t\t-e \"s/^\\(X-Mailer:\\).*/\\1 X-MAILER-STRING/\"\n+}\n+\n test_suppression () {\n \tgit send-email \\\n \t\t--dry-run \\\n@@ -526,10 +532,7 @@ test_suppression () {\n \t\t--from=\"Example <from@example.com>\" \\\n \t\t--to=to@example.com \\\n \t\t--smtp-server relay.example.com \\\n-\t\t$patches |\n-\tsed\t-e \"s/^\\(Date:\\).*/\\1 DATE-STRING/\" \\\n-\t\t-e \"s/^\\(Message-Id:\\).*/\\1 MESSAGE-ID-STRING/\" \\\n-\t\t-e \"s/^\\(X-Mailer:\\).*/\\1 X-MAILER-STRING/\" \\\n+\t\t$patches | replace_variable_fields \\\n \t\t>actual-suppress-$1${2+\"-$2\"} &&\n \ttest_cmp expected-suppress-$1${2+\"-$2\"} actual-suppress-$1${2+\"-$2\"}\n }\n-- \n1.9.1\n"},{"id":"262594","messageId":"1433168042-28269-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","threadId":"39481","inReplyTo":"1433168042-28269-1-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"[PATCH 2/2] send-email: allow multiple emails using --cc, --to and --bcc","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-01T14:14:02Z","receivedAt":"2015-06-01T14:14:02Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Accept a list of emails separated by commas in flags --cc, --to and\n--bcc.  Multiple addresses can already be given by using these options\nmultiple times, but it is more convenient to allow cutting-and-pasting\na list of addresses from the header of an existing e-mail message,\nwhich already lists them as comma-separated list, as a value to a\nsingle parameter.\n\nThe following format can now be used:\n\n    $ git send-email --to='Jane <jdoe@example.com>, mike@example.com'\n\nHowever format using commas in names doesn't work:\n\n    $ git send-email --to='\"Jane, Doe\" <jdoe@example.com>'\n\nRemove the limitation imposed by 79ee555b (Check and document the\noptions to prevent mistakes, 2006-06-21) which rejected every argument\nwith comma in --cc, --to and --bcc\n\nHelped-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\nSigned-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>\nSigned-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\nSigned-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n---\n Documentation/git-send-email.txt | 21 +++++++++++++++------\n git-send-email.perl              | 33 ++++++++++++++-------------------\n t/t9001-send-email.sh            | 30 ++++++++++++++++++++++++++++++\n 3 files changed, 59 insertions(+), 25 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 043f345..f862fa6 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -49,17 +49,23 @@ Composing\n \tof 'sendemail.annotate'. See the CONFIGURATION section for\n \t'sendemail.multiEdit'.\n \n---bcc=<address>::\n+--bcc=<address>,...::\n \tSpecify a \"Bcc:\" value for each email. Default is the value of\n \t'sendemail.bcc'.\n +\n-The --bcc option must be repeated for each user you want on the bcc list.\n+Addresses containing commas (\"Foo, Bar\" <foobar@example.com>) are not\n+currently supported.\n++\n+This option may be specified multiple times\n \n---cc=<address>::\n+--cc=<address>,...::\n \tSpecify a starting \"Cc:\" value for each email.\n \tDefault is the value of 'sendemail.cc'.\n +\n-The --cc option must be repeated for each user you want on the cc list.\n+Addresses containing commas (\"Foo, Bar\" <foobar@example.com>) are not\n+currently supported.\n++\n+This option may be specified multiple times\n \n --compose::\n \tInvoke a text editor (see GIT_EDITOR in linkgit:git-var[1])\n@@ -110,13 +116,16 @@ is not set, this will be prompted for.\n \tOnly necessary if --compose is also set.  If --compose\n \tis not set, this will be prompted for.\n \n---to=<address>::\n+--to=<address>,...::\n \tSpecify the primary recipient of the emails generated. Generally, this\n \twill be the upstream maintainer of the project involved. Default is the\n \tvalue of the 'sendemail.to' configuration value; if that is unspecified,\n \tand --to-cmd is not specified, this will be prompted for.\n +\n-The --to option must be repeated for each user you want on the to list.\n+Addresses containing commas (\"Foo, Bar\" <foobar@example.com>) are not\n+currently supported.\n++\n+This option may be specified multiple times\n \n --8bit-encoding=<encoding>::\n \tWhen encountering a non-ASCII message or subject that does not\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex ffea500..389f19c 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -460,20 +460,6 @@ my ($repoauthor, $repocommitter);\n ($repoauthor) = Git::ident_person(@repo, 'author');\n ($repocommitter) = Git::ident_person(@repo, 'committer');\n \n-# Verify the user input\n-\n-foreach my $entry (@initial_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 sub parse_address_line {\n \tif ($have_mail_address) {\n \t\treturn map { $_->format } Mail::Address->parse($_[0]);\n@@ -838,11 +824,11 @@ sub expand_one_alias {\n }\n \n @initial_to = expand_aliases(@initial_to);\n-@initial_to = validate_address_list(sanitize_address_list(@initial_to));\n+@initial_to = extract_address_list(@initial_to);\n @initial_cc = expand_aliases(@initial_cc);\n-@initial_cc = validate_address_list(sanitize_address_list(@initial_cc));\n+@initial_cc = extract_address_list(@initial_cc);\n @bcclist = expand_aliases(@bcclist);\n-@bcclist = validate_address_list(sanitize_address_list(@bcclist));\n+@bcclist = extract_address_list(@bcclist);\n \n if ($thread && !defined $initial_reply_to && $prompting) {\n \t$initial_reply_to = ask(\n@@ -1055,6 +1041,15 @@ sub sanitize_address_list {\n \treturn (map { sanitize_address($_) } @_);\n }\n \n+sub split_address_list_items {\n+\treturn (map { split /\\s*,\\s*/, $_ } @_);\n+}\n+\n+sub extract_address_list {\n+\treturn validate_address_list(sanitize_address_list(\n+\t\tsplit_address_list_items(@_)));\n+}\n+\n # Returns the local Fully Qualified Domain Name (FQDN) if available.\n #\n # Tightly configured MTAa require that a caller sends a real DNS\n@@ -1564,8 +1559,8 @@ foreach my $t (@files) {\n \t\t($confirm =~ /^(?:auto|compose)$/ && $compose && $message_num == 1));\n \t$needs_confirm = \"inform\" if ($needs_confirm && $confirm_unconfigured && @cc);\n \n-\t@to = validate_address_list(sanitize_address_list(@to));\n-\t@cc = validate_address_list(sanitize_address_list(@cc));\n+\t@to = extract_address_list(@to);\n+\t@cc = extract_address_list(@cc);\n \n \t@to = (@initial_to, @to);\n \t@cc = (@initial_cc, @cc);\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 71968ee..4245c06 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -1612,4 +1612,34 @@ test_expect_success $PREREQ '--[no-]xmailer with sendemail.xmailer=false' '\n \tdo_xmailer_test 1 \"--xmailer\"\n '\n \n+test_expect_success $PREREQ 'setup expected-list' '\n+\tgit send-email \\\n+\t--dry-run \\\n+\t--from=\"Example <from@example.com>\" \\\n+\t--to=\"to1@example.com\" \\\n+\t--to=\"to2@example.com\" \\\n+\t--to=\"to3@example.com\" \\\n+\t--cc=\"cc1@example.com\" \\\n+\t--cc=\"Cc 1 <cc1@example.com>\" \\\n+\t--cc=\"Cc 2 <cc2@example.com>\" \\\n+\t--bcc=\"bcc1@example.com\" \\\n+\t--bcc=\"bcc2@example.com\" \\\n+\t0001-add-master.patch |\treplace_variable_fields \\\n+\t>expected-list\n+'\n+\n+test_expect_success $PREREQ 'use email list in --cc --to and --bcc' '\n+\tgit send-email \\\n+\t--dry-run \\\n+\t--from=\"Example <from@example.com>\" \\\n+\t--to=\"to1@example.com, to2@example.com\" \\\n+\t--to=\"to3@example.com\" \\\n+\t--cc=\"cc1@example.com, Cc 1 <cc1@example.com>\" \\\n+\t--cc=\"Cc 2 <cc2@example.com>\" \\\n+\t--bcc=\"bcc1@example.com, bcc2@example.com\" \\\n+\t0001-add-master.patch |\treplace_variable_fields \\\n+\t >actual-list &&\n+\ttest_cmp expected-list actual-list\n+'\n+\n test_done\n-- \n1.9.1\n"},{"id":"262605","messageId":"vpqa8wjcvju.fsf@anie.imag.fr","threadId":"39481","inReplyTo":"1433168042-28269-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH 2/2] send-email: allow multiple emails using --cc, --to and --bcc","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2015-06-01T15:12:05Z","receivedAt":"2015-06-01T15:12:05Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n\n> Remove the limitation imposed by 79ee555b (Check and document the\n> options to prevent mistakes, 2006-06-21) which rejected every argument\n> with comma in --cc, --to and --bcc\n\nMissing \".\" at the end of sentence.\n\n> -The --bcc option must be repeated for each user you want on the bcc list.\n> +Addresses containing commas (\"Foo, Bar\" <foobar@example.com>) are not\n> +currently supported.\n> ++\n> +This option may be specified multiple times\n\nLikewise (more instances in the patch).\n\n> +test_expect_success $PREREQ 'setup expected-list' '\n> +\tgit send-email \\\n> +\t--dry-run \\\n> +\t--from=\"Example <from@example.com>\" \\\n> +\t--to=\"to1@example.com\" \\\n> +\t--to=\"to2@example.com\" \\\n> +\t--to=\"to3@example.com\" \\\n> +\t--cc=\"cc1@example.com\" \\\n> +\t--cc=\"Cc 1 <cc1@example.com>\" \\\n> +\t--cc=\"Cc 2 <cc2@example.com>\" \\\n> +\t--bcc=\"bcc1@example.com\" \\\n> +\t--bcc=\"bcc2@example.com\" \\\n> +\t0001-add-master.patch |\treplace_variable_fields \\\n\nTab after |. Not really serious, but why not a space?\n\n> +\t>expected-list\n> +'\n> +\n> +test_expect_success $PREREQ 'use email list in --cc --to and --bcc' '\n> +\tgit send-email \\\n> +\t--dry-run \\\n> +\t--from=\"Example <from@example.com>\" \\\n> +\t--to=\"to1@example.com, to2@example.com\" \\\n> +\t--to=\"to3@example.com\" \\\n> +\t--cc=\"cc1@example.com, Cc 1 <cc1@example.com>\" \\\n> +\t--cc=\"Cc 2 <cc2@example.com>\" \\\n> +\t--bcc=\"bcc1@example.com, bcc2@example.com\" \\\n> +\t0001-add-master.patch |\treplace_variable_fields \\\n> +\t >actual-list &&\n\nYou may drop the space between TAB and >.\n\nI would group the tests: the 'setup' is only used to generate\nexpected-list which is used only in the second test, so one is not\nuseful without the other (we commonly have a 'setup ...' test which sets\nup something used by several other tests).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"262606","messageId":"xmqqiob78nij.fsf@gitster.dls.corp.google.com","threadId":"39481","inReplyTo":"1433168042-28269-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH 2/2] send-email: allow multiple emails using --cc, --to and --bcc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-01T15:19:16Z","receivedAt":"2015-06-01T15:19:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n\n> Accept a list of emails separated by commas in flags --cc, --to and\n> --bcc.  Multiple addresses can already be given by using these options\n> multiple times, but it is more convenient to allow cutting-and-pasting\n> a list of addresses from the header of an existing e-mail message,\n> which already lists them as comma-separated list, as a value to a\n> single parameter.\n>\n> The following format can now be used:\n>\n>     $ git send-email --to='Jane <jdoe@example.com>, mike@example.com'\n>\n> However format using commas in names doesn't work:\n>\n>     $ git send-email --to='\"Jane, Doe\" <jdoe@example.com>'\n\nThat looks as if you are doing \"Remi, Lespinet\", which is not a good\nexample.  I think you want \"Doe, Jane\", the use of comma is when a\nname is spelled in the \"LastName, FirstName\" order.\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index ffea500..389f19c 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -460,20 +460,6 @@ my ($repoauthor, $repocommitter);\n>  ($repoauthor) = Git::ident_person(@repo, 'author');\n>  ($repocommitter) = Git::ident_person(@repo, 'committer');\n>  \n> -# Verify the user input\n> -\n> -foreach my $entry (@initial_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\nSo at this point, each element in @initial_to and friends is one\nitem we got from the user, e.g. \"--to=<arg>\", where <arg> may want\nto include multiple addresses, e.g. \"me, you\".\n\nAnd then later, in the more interesting part of the patch, I find a\npuzzling code.\n\n>  @initial_to = expand_aliases(@initial_to);\n> -@initial_to = validate_address_list(sanitize_address_list(@initial_to));\n> +@initial_to = extract_address_list(@initial_to);\n\nA question: what is in @initial_to at this point in the code,\nimmediately before you call expand_aliases() on it?  Isn't one of\nthe elements be \"me, you\" when I said --to=\"me, you\"?\n\nShouldn't you be splitting that into \"me\" and \"you\" and expand these\ntwo as potential aliases separately?\n\nIn other words, I wonder why the patch needs to be any more complex\nthan this instead:\n\n\t+@initial_to = split_at_comma(@initial_to);\n\t @initial_to = expand_aliases(@initial_to);\n\t @initial_to = validate_address_list(sanitize_address_list(@initial_to));\n\nAs your goal is to treat --to=\"<address 1>, <address 2>\" as if the\nuser said --to=\"<address 1>\" --to=\"<address 2>\", that would be a\nmore straight-forward way to enhance the system, and you shouldn't\nhave to change anything else, no?\n\n\n>  @initial_cc = expand_aliases(@initial_cc);\n> -@initial_cc = validate_address_list(sanitize_address_list(@initial_cc));\n> +@initial_cc = extract_address_list(@initial_cc);\n>  @bcclist = expand_aliases(@bcclist);\n> -@bcclist = validate_address_list(sanitize_address_list(@bcclist));\n> +@bcclist = extract_address_list(@bcclist);\n\nDitto.\n"},{"id":"262618","messageId":"xmqqmw0j74mg.fsf@gitster.dls.corp.google.com","threadId":"39481","inReplyTo":"xmqqiob78nij.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 2/2] send-email: allow multiple emails using --cc, --to and --bcc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-01T16:52:39Z","receivedAt":"2015-06-01T16:52:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n>\n>> Accept a list of emails separated by commas in flags --cc, --to and\n>> --bcc.  Multiple addresses can already be given by using these options\n>> multiple times, but it is more convenient to allow cutting-and-pasting\n>> a list of addresses from the header of an existing e-mail message,\n>> which already lists them as comma-separated list, as a value to a\n>> single parameter.\n>>\n>> The following format can now be used:\n>>\n>>     $ git send-email --to='Jane <jdoe@example.com>, mike@example.com'\n>>\n>> However format using commas in names doesn't work:\n>>\n>>     $ git send-email --to='\"Jane, Doe\" <jdoe@example.com>'\n>\n> That looks as if you are doing \"Remi, Lespinet\", which is not a good\n> example.  I think you want \"Doe, Jane\", the use of comma is when a\n> name is spelled in the \"LastName, FirstName\" order.\n\nHaving thought about this topic (not how the example should be\nspelled in the log message ;-) a bit more, I do not think the\nimplementation of split_address_list_items in this patch is\nacceptable.\n\nThe reason why we have the \"verify the input\" thing, allow users to\nsupply multiple --to/--cc/etc., and do not try to split the\naddresses ourselves is because we want to avoid mistakenly splitting\na single address like the above into two and producing syntactically\nincorrect addresses.  People have relied on the current behaviour\nfor a long time, without manually dropping comma when they send\ntheir patches with --to='\"Jane, Doe\" <jdoe@example.com>'.\n\nUntil we can reliably split the address list, accepting this patch\nwill introduce a regression.\n\nNote that I do agree with the goal of this series and appreciate the\neffort.  I am only rejecting the current implementation of\nsplit_address_list_items().\n\nThanks.\n"},{"id":"262689","messageId":"CA+V2YBvP89=b5SFbkUVnEzaPT2aCiK9XN1Hd6qsN8HCmxxB+GA@mail.gmail.com","threadId":"39481","inReplyTo":"xmqqmw0j74mg.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 2/2] send-email: allow multiple emails using --cc, --to and --bcc","fromName":"Rémi Lespinet","fromEmail":"remi.lespinet@gmail.com","sentAt":"2015-06-02T08:26:11Z","receivedAt":"2015-06-02T08:26:11Z","isPatch":true,"sender":{"key":"remi.lespinet@gmail.com","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> The reason why we have the \"verify the input\" thing, allow users to\n> supply multiple --to/--cc/etc., and do not try to split the\n> addresses ourselves is because we want to avoid mistakenly splitting\n> a single address like the above into two and producing syntactically\n> incorrect addresses.  People have relied on the current behaviour\n> for a long time, without manually dropping comma when they send\n> their patches with --to='\"Jane, Doe\" <jdoe@example.com>'.\n\nYes, but they couldn't send with --to='\"Jane, Doe\" <jdoe@example.com>'\nanyway since 79ee555b (Check and document the options to prevent\nmistakes. 2006-06-21).  So I don't think that this part is a\nregression. However when the user input is incorrect and contains\ncomma, the mail will be sent to the syntaxically valid addresses which\nhave been extracted and this would have failed without sending before\nthis patch. I agree that this part is not a desirable behavior.\nIf I fix that, would it be ok for you?\n\n2015-06-01 18:52 GMT+02:00 Junio C Hamano <gitster@pobox.com>:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n>>\n>>> Accept a list of emails separated by commas in flags --cc, --to and\n>>> --bcc.  Multiple addresses can already be given by using these options\n>>> multiple times, but it is more convenient to allow cutting-and-pasting\n>>> a list of addresses from the header of an existing e-mail message,\n>>> which already lists them as comma-separated list, as a value to a\n>>> single parameter.\n>>>\n>>> The following format can now be used:\n>>>\n>>>     $ git send-email --to='Jane <jdoe@example.com>, mike@example.com'\n>>>\n>>> However format using commas in names doesn't work:\n>>>\n>>>     $ git send-email --to='\"Jane, Doe\" <jdoe@example.com>'\n>>\n>> That looks as if you are doing \"Remi, Lespinet\", which is not a good\n>> example.  I think you want \"Doe, Jane\", the use of comma is when a\n>> name is spelled in the \"LastName, FirstName\" order.\n>\n> Having thought about this topic (not how the example should be\n> spelled in the log message ;-) a bit more, I do not think the\n> implementation of split_address_list_items in this patch is\n> acceptable.\n>\n> The reason why we have the \"verify the input\" thing, allow users to\n> supply multiple --to/--cc/etc., and do not try to split the\n> addresses ourselves is because we want to avoid mistakenly splitting\n> a single address like the above into two and producing syntactically\n> incorrect addresses.  People have relied on the current behaviour\n> for a long time, without manually dropping comma when they send\n> their patches with --to='\"Jane, Doe\" <jdoe@example.com>'.\n>\n> Until we can reliably split the address list, accepting this patch\n> will introduce a regression.\n>\n> Note that I do agree with the goal of this series and appreciate the\n> effort.  I am only rejecting the current implementation of\n> split_address_list_items().\n>\n> Thanks.\n>\n>\n>\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"262747","messageId":"xmqqbngy3u5e.fsf@gitster.dls.corp.google.com","threadId":"39481","inReplyTo":"CA+V2YBvP89=b5SFbkUVnEzaPT2aCiK9XN1Hd6qsN8HCmxxB+GA@mail.gmail.com","subject":"Re: [PATCH 2/2] send-email: allow multiple emails using --cc, --to and --bcc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-02T17:19:25Z","receivedAt":"2015-06-02T17:19:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Rémi Lespinet <remi.lespinet@gmail.com> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> The reason why we have the \"verify the input\" thing, allow users to\n>> supply multiple --to/--cc/etc., and do not try to split the\n>> addresses ourselves is because we want to avoid mistakenly splitting\n>> a single address like the above into two and producing syntactically\n>> incorrect addresses.  People have relied on the current behaviour\n>> for a long time, without manually dropping comma when they send\n>> their patches with --to='\"Jane, Doe\" <jdoe@example.com>'.\n>\n> Yes, but they couldn't send with --to='\"Jane, Doe\" <jdoe@example.com>'\n> anyway since 79ee555b (Check and document the options to prevent\n> mistakes. 2006-06-21).  So I don't think that this part is a\n> regression.\n\nAhh, stupid me.  Thanks.\n\nThen starting with the \"split at the comma\" implementation is\nperfectly fine.  People will learn not to use '\"Doe, Jane\" <jdoe>'\nbecause that will not work while the implementation is limited, and\nlater when it is enhanced, they can start using that form.\n"}]}