{"thread":{"id":"39446","subject":"[PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","startedAt":"2015-05-28T10:42:12Z","lastAt":"2015-05-29T18:04:29Z","messageCount":11,"participants":["Remi Lespinet","Matthieu Moy","Eric Sunshine","Junio C Hamano","Remi LESPINET"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"262315","messageId":"1432809733-4321-1-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","threadId":"39446","inReplyTo":null,"subject":"[PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-05-28T10:42:12Z","receivedAt":"2015-05-28T10:42:12Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Hello,\n\nI've corrected an old patch from an Ensimag student.\n(http://thread.gmane.org/gmane.comp.version-control.git/228182). This\npatch allows multiple email addresses for options --cc, --to and\n--bcc. As said in the commit message, this patch doesn't handle commas\nin name, and the only possibility for using commas in name is to use the\nrfc2047 syntax:\n\nTo: =?ISO-8859-1?Q?Ex=2C_ample?= <to@a.com>\n\nI would like to add the possibility to use the following command lines:\n\n    git send-email --to '\"Ex, am ple\" <to@a.com>'\n\n    git send-email --to '\"Ex, am\" \"ple\" <to@a.com>'\n\n    git send-email --to \"\\\"Ex, am ple\\\" <to@a.com>\"\n\n    git send-email --to \"\\\"Ex, am\\\" \\\"ple\\\" <to@a.com>\"\n\n\nHere are my questions :\nIs this a good idea to handle commas in name ?\nDo you have any suggestion about proposed syntaxes ?\n"},{"id":"262316","messageId":"1432809733-4321-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","threadId":"39446","inReplyTo":"1432809733-4321-1-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"[PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-05-28T10:42:13Z","receivedAt":"2015-05-28T10:42:13Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"From: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>\n\nAdd the possibility to use a list of emails separated by commas\nin flags --cc --to and --bcc instead of having to use one flag\nper email address.\n\nThe use-case is to copy-paste a list of addresses from an email.\nThis change makes it so that we no longer need to cut the list.\n\nThe format of email list handled is basic for now:\n\t$ git send-email --to='Foo <foo@example.com>, bar@example.com'\nWe thought it would be nice to have a \"first-step\" version which works\nbefore handling more complex ones such as names with commas:\n\t$ git send-email --to='Foo, Bar <foobar@example.com>'\n\nThis artificial limitation is imposed by 79ee555b (Check and document\nthe options to prevent mistakes, 2006-06-21).\n\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>\nContributions-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n---\n Documentation/git-send-email.txt | 23 ++++++++++++++--------\n git-send-email.perl              | 21 ++++++--------------\n t/t9001-send-email.sh            | 41 ++++++++++++++++++++++++++++++++++++----\n 3 files changed, 58 insertions(+), 27 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 043f345..0aeddcb 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -49,17 +49,21 @@ 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+\tThe format supported for email list is the following:\n+\t\"Foo <foo@example.com>, bar@example.com\".\n+\tPlease notice that the email list does not handle commas in\n+\temail names such as \"Foo, Bar <foobar@example.com>\".\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+\tThe format supported for email list is the following:\n+\t\"Foo <foo@example.com>, bar@example.com\".\n+\tPlease notice that the email list does not handle commas in\n+\temail names such as \"Foo, Bar <foobar@example.com>\".\n \n --compose::\n \tInvoke a text editor (see GIT_EDITOR in linkgit:git-var[1])\n@@ -111,12 +115,15 @@ is not set, this will be prompted for.\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+\tThe format supported for email list is the following:\n+\t\"Foo <foo@example.com>, bar@example.com\".\n+\tPlease notice that the email list does not handle commas in\n+\temail names such as \"Foo, Bar <foobar@example.com>\".\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..409ff45 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@@ -1052,7 +1038,8 @@ sub sanitize_address {\n }\n \n sub sanitize_address_list {\n-\treturn (map { sanitize_address($_) } @_);\n+\tmy @addr_list = split_address_list(@_);\n+\treturn (map { sanitize_address($_) } @addr_list);\n }\n \n # Returns the local Fully Qualified Domain Name (FQDN) if available.\n@@ -1193,6 +1180,10 @@ sub file_name_is_absolute {\n \treturn File::Spec::Functions::file_name_is_absolute($path);\n }\n \n+sub split_address_list {\n+\treturn (map { split /\\s*,\\s*/, $_ } @_);\n+}\n+\n # Returns 1 if the message was sent, and 0 otherwise.\n # In actuality, the whole program dies when there\n # is an error sending a message.\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex a3663da..4245c06 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@@ -1609,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":"262319","messageId":"vpqd21kvs8m.fsf@anie.imag.fr","threadId":"39446","inReplyTo":"1432809733-4321-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2015-05-28T11:47:21Z","receivedAt":"2015-05-28T11:47:21Z","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> --- 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\nI wouldn't insist on that, but this change would be better done in a\nseparate, preparatory patch (that would be PATCH 1/2, and the actual\ncode would be PATCH 2/2).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"262334","messageId":"CAPig+cRb0GstQThkprzBA=VwHSFxUeX6KDdSA7Xjdb_B2mH6Uw@mail.gmail.com","threadId":"39446","inReplyTo":"1432809733-4321-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-05-28T15:26:06Z","receivedAt":"2015-05-28T15:26:06Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, May 28, 2015 at 6:42 AM, Remi Lespinet\n<remi.lespinet@ensimag.grenoble-inp.fr> wrote:\n> Add the possibility to use a list of emails separated by commas\n> in flags --cc --to and --bcc instead of having to use one flag\n\ns/--cc --to/--cc, --to/\n\nDitto in subject.\n\n> per email address.\n>\n> The use-case is to copy-paste a list of addresses from an email.\n> This change makes it so that we no longer need to cut the list.\n>\n> The format of email list handled is basic for now:\n>         $ git send-email --to='Foo <foo@example.com>, bar@example.com'\n> We thought it would be nice to have a \"first-step\" version which works\n> before handling more complex ones such as names with commas:\n>         $ git send-email --to='Foo, Bar <foobar@example.com>'\n>\n> This artificial limitation is imposed by 79ee555b (Check and document\n> the options to prevent mistakes, 2006-06-21).\n>\n> Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>\n> Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\n> Contributions-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n\nHelped-by: may be more appropriate than Contributions-by: on this\nproject. Also, move it above the sign-offs.\n\n> ---\n> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n> index 043f345..0aeddcb 100644\n> --- a/Documentation/git-send-email.txt\n> +++ b/Documentation/git-send-email.txt\n> @@ -49,17 +49,21 @@ Composing\n>         of 'sendemail.annotate'. See the CONFIGURATION section for\n>         'sendemail.multiEdit'.\n>\n> ---bcc=<address>::\n> +--bcc=\"[<address>,...]\"::\n\nAdding square brackets indicates that the addresses following '=' are\noptional, which is incorrect. It should be sufficient merely to add\nthe comma and ellipsis. Also, the need to quote strings containing\nwhitespace is a shell issue not specifically related to this option.\nThat is, people have to understand quoting issues in general, so it\ndoesn't make sense to mention them literally here. Thus:\n\n    --bcc=<address>,...::\n\nshould be sufficient.\n\n>         Specify a \"Bcc:\" value for each email. Default is the value of\n>         'sendemail.bcc'.\n> -+\n> -The --bcc option must be repeated for each user you want on the bcc list.\n\nI think it's harmful to remove this line. Although the \"must\" is no\nlonger true following this change, it's still important for people to\nknow that they can use --bcc multiple times. So, perhaps just reword\nit:\n\n    This option may be specified multiple times.\n\n> +       The format supported for email list is the following:\n> +       \"Foo <foo@example.com>, bar@example.com\".\n> +       Please notice that the email list does not handle commas in\n> +       email names such as \"Foo, Bar <foobar@example.com>\".\n\nA few issues:\n\nIn order for this to format correctly in Asciidoc, the text needs to\nbe left-justified (just as was the line which you removed).\n\nThe sentence \"The format supported...\" seems superfluous. It's merely\nrepeating what is already clearly indicated by \"--bcc=<address>,...\",\nthus it could easily be dropped without harm.\n\nMention that commas in names are not currently handled is indeed a\ngood idea, however, \"please\" tends to be an overused and wasted word\nin documentation. More tersely:\n\n    Note: Addresses containing commas (\"Foo, Bar\" <...>)\n    are not currently supported.\n\nThe above comments also apply to --cc and --to.\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index ffea500..409ff45 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -1052,7 +1038,8 @@ sub sanitize_address {\n>  }\n>\n>  sub sanitize_address_list {\n> -       return (map { sanitize_address($_) } @_);\n> +       my @addr_list = split_address_list(@_);\n> +       return (map { sanitize_address($_) } @addr_list);\n>  }\n\nAlthough, it was convenient from an implementation perspective to plop\nthe split_address_list() invocation into sanitize_address_list(), it\npollutes sanitize_address_list() by making it do something unrelated\nto its purpose.\n\nIf you examine places where sanitize_address_list() is called, you will see:\n\n    validate_address_list(sanitize_address_list(@xx))\n\nwhich clearly shows that sanitation and validation are distinct\noperations (and each function does only what its name implies). To\ncontinue this idea, the splitting of addresses should be performed\ndistinctly from the other operations, in this order:\n\n   split -> sanitize -> validate\n\nor:\n\n    validate_address_list(sanitize_address_list(\n        split_address_list(@xx))\n\nThat's pretty verbose, so introducing a new function to encapsulates\nthat behavior might be reasonable.\n\n>  # Returns the local Fully Qualified Domain Name (FQDN) if available.\n> @@ -1193,6 +1180,10 @@ sub file_name_is_absolute {\n>         return File::Spec::Functions::file_name_is_absolute($path);\n>  }\n>\n> +sub split_address_list {\n> +       return (map { split /\\s*,\\s*/, $_ } @_);\n> +}\n\nThis is somewhat misnamed. It's not splitting the address list in the\nsense that sanitize_address_list() and validate_address_list() operate\non the list of addresses. The name implies that it's somehow\npartitioning the list of addresses, but in fact it's iterating over\nthe incoming list and (possibly) splitting each item into multiple\npieces. Perhaps a better name would be split_address_list_items() or\nsomething.\n\n>  # Returns 1 if the message was sent, and 0 otherwise.\n>  # In actuality, the whole program dies when there\n>  # is an error sending a message.\n"},{"id":"262350","messageId":"xmqq382giokd.fsf@gitster.dls.corp.google.com","threadId":"39446","inReplyTo":"1432809733-4321-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-28T17:45:06Z","receivedAt":"2015-05-28T17:45:06Z","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> From: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>\n>\n> Add the possibility to use a list of emails separated by commas\n> in flags --cc --to and --bcc instead of having to use one flag\n> per email address.\n>\n> The use-case is to copy-paste a list of addresses from an email.\n> This change makes it so that we no longer need to cut the list.\n\ns/Add the possibility to use/Accept/;\n\nI am not sure \"having to use\" is a good characterization.\n\n    Accept a list of emails separated by commas in flags --cc, --to\n    and --bcc.  Multiple addresses can already be given by using\n    these options multiple times, but it is more convenient to allow\n    cutting-and-pasting a list of addresses from the header of an\n    existing e-mail message, which already lists them as\n    comma-separated list, as a value to a single parameter.\n\nperhaps?\n\n> The format of email list handled is basic for now:\n> \t$ git send-email --to='Foo <foo@example.com>, bar@example.com'\n> We thought it would be nice to have a \"first-step\" version which works\n\nSeparate displayed material from the body text with blank lines, i.e.\n\n        The format of email list handled is basic for now:\n\n                $ git send-email --to='Foo ...\n\n        We thought it would be nice to have a \"first-step\" version which works\n\n\"We thought\"?\n\n> before handling more complex ones such as names with commas:\n> \t$ git send-email --to='Foo, Bar <foobar@example.com>'\n\nShouldn't this example send to two users, i.e. a local user Foo and\nthe mailbox 'foobar' at example.com whose human-readable name is\nBar?  If so, that is a bad example to illustrate the aspiration for\nthe finished patch?\n\n> This artificial limitation is imposed by 79ee555b (Check and document\n> the options to prevent mistakes, 2006-06-21).\n\nIt is unclear from this sentence what you are doing with the\nlimitation (is it artificial?  do we have to call it artificial?).\nThe reader of the log message cannot tell if you are keeping it, or\nif you are lifting it with this patch.\n\n> Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>\n> Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>\n> Contributions-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n\nYou touched the patch or sent it out, so you need to give your own\nsign-off.\n\nThanks.\n"},{"id":"262354","messageId":"CAPig+cR_N10=k6QX=udpfWG-qNYkBNXQQNZ-LOrGC=1UqoZcVw@mail.gmail.com","threadId":"39446","inReplyTo":"CAPig+cRb0GstQThkprzBA=VwHSFxUeX6KDdSA7Xjdb_B2mH6Uw@mail.gmail.com","subject":"Re: [PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-05-28T18:02:36Z","receivedAt":"2015-05-28T18:02:36Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, May 28, 2015 at 11:26 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n> On Thu, May 28, 2015 at 6:42 AM, Remi Lespinet\n> <remi.lespinet@ensimag.grenoble-inp.fr> wrote:\n>> +       The format supported for email list is the following:\n>> +       \"Foo <foo@example.com>, bar@example.com\".\n>> +       Please notice that the email list does not handle commas in\n>> +       email names such as \"Foo, Bar <foobar@example.com>\".\n>\n> A few issues:\n>\n> In order for this to format correctly in Asciidoc, the text needs to\n> be left-justified (just as was the line which you removed).\n\ns/left-justified/unindented/\n\n> The sentence \"The format supported...\" seems superfluous. It's merely\n> repeating what is already clearly indicated by \"--bcc=<address>,...\",\n> thus it could easily be dropped without harm.\n>\n> Mention that commas in names are not currently handled is indeed a\n\ns/Mention/Mentioning/\n\n> good idea, however, \"please\" tends to be an overused and wasted word\n> in documentation. More tersely:\n>\n>     Note: Addresses containing commas (\"Foo, Bar\" <...>)\n>     are not currently supported.\n> [...]\n>>  sub sanitize_address_list {\n>> -       return (map { sanitize_address($_) } @_);\n>> +       my @addr_list = split_address_list(@_);\n>> +       return (map { sanitize_address($_) } @addr_list);\n>>  }\n>\n> Although, it was convenient from an implementation perspective to plop\n> the split_address_list() invocation into sanitize_address_list(), it\n> pollutes sanitize_address_list() by making it do something unrelated\n> to its purpose.\n>\n> If you examine places where sanitize_address_list() is called, you will see:\n>\n>     validate_address_list(sanitize_address_list(@xx))\n>\n> which clearly shows that sanitation and validation are distinct\n\nOops: s/sanitation/sanitization/\n\n> operations (and each function does only what its name implies). To\n> continue this idea, the splitting of addresses should be performed\n> distinctly from the other operations, in this order:\n>\n>    split -> sanitize -> validate\n>\n> or:\n>\n>     validate_address_list(sanitize_address_list(\n>         split_address_list(@xx))\n>\n> That's pretty verbose, so introducing a new function to encapsulates\n> that behavior might be reasonable.\n"},{"id":"262431","messageId":"87oal32wuj.fsf@ensimag.grenoble-inp.fr","threadId":"39446","inReplyTo":"xmqq382giokd.fsf@gitster.dls.corp.google.com","subject":"[PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Remi LESPINET","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-05-29T16:05:08Z","receivedAt":"2015-05-29T16:05:08Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?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\n>     and --bcc.  Multiple addresses can already be given by using\n>     these options multiple times, but it is more convenient to allow\n>     cutting-and-pasting a list of addresses from the header of an\n>     existing e-mail message, which already lists them as\n>     comma-separated list, as a value to a single parameter.\n>\n> perhaps?\nI've taken this description for the first part of the commit\nmessage. Thanks!\n\n> > before handling more complex ones such as names with commas:\n> >         $ git send-email --to='Foo, Bar <foobar@example.com>'\n> \n> Shouldn't this example send to two users, i.e. a local user Foo and\n> the mailbox 'foobar' at example.com whose human-readable name is\n> Bar?  If so, that is a bad example to illustrate the aspiration for\n> the finished patch?\n\nYes, that works if Foo is in an alias file, so that's clearly a bad\nexample, I added quotes:\n\n\tgit send-email --to='\"Foo, Bar\" <foobar@example.com>'\n\nThanks!\n"},{"id":"262433","messageId":"87h9qv2wqp.fsf@ensimag.grenoble-inp.fr","threadId":"39446","inReplyTo":"CAPig+cR_N10=k6QX=udpfWG-qNYkBNXQQNZ-LOrGC=1UqoZcVw@mail.gmail.com","subject":"[PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Remi LESPINET","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-05-29T16:07:26Z","receivedAt":"2015-05-29T16:07:26Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> <remi.lespinet@ensimag.grenoble-inp.fr> wrote:\n> \n>     validate_address_list(sanitize_address_list(\n>         split_address_list(@xx))\n> \n> That's pretty verbose, so introducing a new function to encapsulates\n> that behavior might be reasonable.\n\nAgreed, If you have any suggestion for the name of this function, I'll\nbe happy to use it, I named it extract_address_list, but I'm not sure\nthat it's a good name.\n\nThanks again for the review!\n"},{"id":"262434","messageId":"xmqqa8wne50t.fsf@gitster.dls.corp.google.com","threadId":"39446","inReplyTo":"87oal32wuj.fsf@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-29T16:13:06Z","receivedAt":"2015-05-29T16:13:06Z","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> Yes, that works if Foo is in an alias file, so that's clearly a bad\n> example, I added quotes:\n>\n> \tgit send-email --to='\"Foo, Bar\" <foobar@example.com>'\n\nI'd further suggest replacing \", Bar\" with something a bit more\nrealistic that people use in real life, e.g. \", Esq.\" or \", PhD\"\n(e.g. \"Jane Doe, Esq.\")\n"},{"id":"262441","messageId":"vpqh9qvp8sw.fsf@anie.imag.fr","threadId":"39446","inReplyTo":"xmqqa8wne50t.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2015-05-29T17:55:59Z","receivedAt":"2015-05-29T17:55:59Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Remi LESPINET <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n>\n>> Yes, that works if Foo is in an alias file, so that's clearly a bad\n>> example, I added quotes:\n>>\n>> \tgit send-email --to='\"Foo, Bar\" <foobar@example.com>'\n>\n> I'd further suggest replacing \", Bar\" with something a bit more\n> realistic that people use in real life, e.g. \", Esq.\" or \", PhD\"\n> (e.g. \"Jane Doe, Esq.\")\n\nWhy not, but it's also not uncommon to see \"Last, First\", like\n\"Moy, Matthieu\" <Matthieu.Moy@imag.fr>.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"262443","messageId":"xmqqoal3claq.fsf@gitster.dls.corp.google.com","threadId":"39446","inReplyTo":"vpqh9qvp8sw.fsf@anie.imag.fr","subject":"Re: [PATCH/RFC] send-email: allow multiple emails using --cc --to and --bcc","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-29T18:04:29Z","receivedAt":"2015-05-29T18:04:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Remi LESPINET <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n>>\n>>> Yes, that works if Foo is in an alias file, so that's clearly a bad\n>>> example, I added quotes:\n>>>\n>>> \tgit send-email --to='\"Foo, Bar\" <foobar@example.com>'\n>>\n>> I'd further suggest replacing \", Bar\" with something a bit more\n>> realistic that people use in real life, e.g. \", Esq.\" or \", PhD\"\n>> (e.g. \"Jane Doe, Esq.\")\n>\n> Why not, but it's also not uncommon to see \"Last, First\", like\n> \"Moy, Matthieu\" <Matthieu.Moy@imag.fr>.\n\n\", Bar\" is not clear what its relationship is to \"Foo\", but with \",\nMatthieu\" it is clear what is going on, so that is fine, too.\n"}]}