{"thread":{"id":"39416","subject":"[PATCH v5 1/1] send-email: Add sendmail email aliases format","startedAt":"2015-05-23T13:21:27Z","lastAt":"2015-05-26T21:04:41Z","messageCount":20,"participants":["Allen Hubbe","Junio C Hamano","Eric Sunshine"],"isPatch":true,"patchVersion":5,"patchTotal":1},"messages":[{"id":"261990","messageId":"49e9a95b52aa61ed4f37edf1dfa178186acb4a29.1432367540.git.allenbh@gmail.com","threadId":"39416","inReplyTo":null,"subject":"[PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Allen Hubbe","fromEmail":"allenbh@gmail.com","sentAt":"2015-05-23T13:21:27Z","receivedAt":"2015-05-23T13:21:27Z","isPatch":true,"sender":{"key":"allenbh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/812915?v=4"},"body":"Note that this only adds support for a limited subset of the sendmail\nformat.  The format is is as follows.\n\n\t<alias>: <address|alias>[, <address|alias>...]\n\nAliases are specified one per line, and must start on the first column of the\nline.  Blank lines are ignored.  If the first non whitespace character\non a line is a '#' symbol, then the whole line is considered a comment,\nand is ignored.\n\nExample:\n\n\talice: Alice W Land <awol@example.com>\n\tbob: Robert Bobbyton <bob@example.com>\n\t# this is a comment\n\t   # this is also a comment\n\tchloe: chloe@example.com\n\tabgroup: alice, bob\n\tbcgrp: bob, chloe, Other <o@example.com>\n\nUnlike the standard sendmail format, this does not support quoted\naliases or quoted addresses.  Line continuations are not supported.\nWarnings are printed for explicitly unsupported constructs, and any\nother lines that are not recognized.\n\nSigned-off-by: Allen Hubbe <allenbh@gmail.com>\n---\n\nNotes:\n    This v5 renames the parser 'sendmail' again, from 'simple'.\n    Therefore, the subject line is changed again, too.\n    \n    Previous subject line: send-email: Add simple email aliases format\n    \n    The format is restricted to a subset of sendmail.  When the subset\n    diverges from sendmail, the parser warns about the line that diverges,\n    and ignores the line.  The supported format is described in the\n    documentation, as well as the behavior when an unsupported format\n    construct is detected.\n    \n    A badly constructed sentence was corrected in the documentation.\n    \n    The test case was changed to use a here document, and the unsupported\n    comment after an alias was removed from the test case alias file input.\n\n Documentation/git-send-email.txt | 37 ++++++++++++++++++++++++++++++++++++-\n git-send-email.perl              | 29 +++++++++++++++++++++++++++++\n t/t9001-send-email.sh            | 27 +++++++++++++++++++++++++++\n 3 files changed, 92 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 804554609def..97387fd27a8d 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -383,7 +383,42 @@ sendemail.aliasesFile::\n \n sendemail.aliasFileType::\n \tFormat of the file(s) specified in sendemail.aliasesFile. Must be\n-\tone of 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.\n+\tone of 'sendmail', 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.\n++\n+If the format is 'sendmail', then the alias file format is described below.\n+Descriptions of the other file formats can be found by searching the\n+documentation of the email program of the same name.\n++\n+The 'sendmail' format is is as follows.  Note that 'git-send-email' currently\n+only supports a limited subset of the sendmail format.\n++\n+\t<alias>: <address|alias>[, <address|alias>...]\n++\n+Aliases are specified one per line, and must start on the first column of the\n+line.  Blank lines are ignored.  If the first non whitespace character on a\n+line is a `#` symbol, then the whole line is considered a comment, and is\n+ignored.\n++\n+Example of the 'sendmail' format:\n++\n+\talice: Alice W Land <awol@example.com>\n+\tbob: Robert Bobbyton <bob@example.com>\n+\t# this is a comment\n+\t   # this is also a comment\n+\tchloe: chloe@example.com\n+\tabgroup: alice, bob\n+\tbcgrp: bob, chloe, Other <o@example.com>\n++\n+Unlike the standard sendmail format, 'git-send-email' currently diverges in the\n+following ways.\n++\n+*\tQuoted aliases and quoted addresses are not supported: lines that\n+\tcontain a `\"` symbol are ignored.\n+*\tLine continuations are not supported: any lines that start with\n+\twhitespace, or end with a `\\` symbol are ignored.\n+*\tWarnings are printed on the standard error output for any explicitly\n+\tunsupported constructs, and any other lines that are not recognized\n+\tby the parser.\n \n sendemail.multiEdit::\n \tIf true (default), a single editor instance will be spawned to edit\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e1e9b1460ced..ffea50094a48 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -487,6 +487,8 @@ sub split_addrs {\n }\n \n my %aliases;\n+\n+\n my %parse_alias = (\n \t# multiline formats can be supported in the future\n \tmutt => sub { my $fh = shift; while (<$fh>) {\n@@ -516,6 +518,33 @@ my %parse_alias = (\n \t\t\t  }\n \t\t      } },\n \n+\tsendmail => sub { my $fh = shift; while (<$fh>) {\n+\t\t# ignore comment lines\n+\t\tif (/^\\s*(?:#.*)?$/) { }\n+\n+\t\t# warn on lines that contain quotes\n+\t\telsif (/\"/) {\n+\t\t\tprint STDERR \"sendmail alias with quotes is not supported: $_\\n\";\n+\t\t\tnext;\n+\t\t}\n+\n+\t\t# warn on lines that continue\n+\t\telsif (/^\\s|\\\\$/) {\n+\t\t\tprint STDERR \"sendmail continuation line is not supported: $_\\n\";\n+\t\t\tnext;\n+\t\t}\n+\n+\t\t# recognize lines that look like an alias\n+\t\telsif (/^(\\S+)\\s*:\\s*(.+?)$/) {\n+\t\t\tmy ($alias, $addr) = ($1, $2);\n+\t\t\t$aliases{$alias} = [ split_addrs($addr) ];\n+\t\t}\n+\n+\t\t# warn on lines that are not recognized\n+\t\telse {\n+\t\t\tprint STDERR \"sendmail line is not recognized: $_\\n\";\n+\t\t}}},\n+\n \tgnus => sub { my $fh = shift; while (<$fh>) {\n \t\tif (/\\(define-mail-alias\\s+\"(\\S+?)\"\\s+\"(\\S+?)\"\\)/) {\n \t\t\t$aliases{$1} = [ $2 ];\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 7be14a4e37f7..b04d26364767 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -1549,6 +1549,33 @@ test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '\n \tgrep \"^!someone@example\\.org!$\" commandline1\n '\n \n+test_expect_success $PREREQ 'sendemail.aliasfiletype=sendmail' '\n+\tclean_fake_sendmail && rm -fr outdir &&\n+\tgit format-patch -1 -o outdir &&\n+\tcat >>~/.tmp-email-aliases <<-\\EOF &&\n+\talice: Alice W Land <awol@example.com>\n+\tbob: Robert Bobbyton <bob@example.com>\n+\t# this is a comment\n+\t   # this is also a comment\n+\tchloe: chloe@example.com\n+\tabgroup: alice, bob\n+\tbcgrp: bob, chloe, Other <o@example.com>\n+\tEOF\n+\tgit config --replace-all sendemail.aliasesfile \\\n+\t\t\"$(pwd)/.tmp-email-aliases\" &&\n+\tgit config sendemail.aliasfiletype sendmail &&\n+\tgit send-email \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t--to=alice --to=bcgrp \\\n+\t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n+\t\toutdir/0001-*.patch \\\n+\t\t2>errors >out &&\n+\tgrep \"^!awol@example\\.com!$\" commandline1 &&\n+\tgrep \"^!bob@example\\.com!$\" commandline1 &&\n+\tgrep \"^!chloe@example\\.com!$\" commandline1 &&\n+\tgrep \"^!o@example\\.com!$\" commandline1\n+'\n+\n do_xmailer_test () {\n \texpected=$1 params=$2 &&\n \tgit format-patch -1 &&\n-- \n2.3.4\n"},{"id":"262000","messageId":"xmqqfv6nchmf.fsf@gitster.dls.corp.google.com","threadId":"39416","inReplyTo":"49e9a95b52aa61ed4f37edf1dfa178186acb4a29.1432367540.git.allenbh@gmail.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-23T17:45:44Z","receivedAt":"2015-05-23T17:45:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Allen Hubbe <allenbh@gmail.com> writes:\n\n> Note that this only adds support for a limited subset of the sendmail\n> format.  The format is is as follows.\n>\n> \t<alias>: <address|alias>[, <address|alias>...]\n>\n> Aliases are specified one per line, and must start on the first column of the\n> line.  Blank lines are ignored.  If the first non whitespace character\n> on a line is a '#' symbol, then the whole line is considered a comment,\n> and is ignored.\n>\n> Example:\n>\n> \talice: Alice W Land <awol@example.com>\n> \tbob: Robert Bobbyton <bob@example.com>\n> \t# this is a comment\n> \t   # this is also a comment\n> \tchloe: chloe@example.com\n> \tabgroup: alice, bob\n> \tbcgrp: bob, chloe, Other <o@example.com>\n>\n> Unlike the standard sendmail format, this does not support quoted\n> aliases or quoted addresses.  Line continuations are not supported.\n> Warnings are printed for explicitly unsupported constructs, and any\n> other lines that are not recognized.\n>\n> Signed-off-by: Allen Hubbe <allenbh@gmail.com>\n> ---\n>\n> Notes:\n>     This v5 renames the parser 'sendmail' again, from 'simple'.\n>     Therefore, the subject line is changed again, too.\n>     \n>     Previous subject line: send-email: Add simple email aliases format\n>     \n>     The format is restricted to a subset of sendmail.  When the subset\n>     diverges from sendmail, the parser warns about the line that diverges,\n>     and ignores the line.  The supported format is described in the\n>     documentation, as well as the behavior when an unsupported format\n>     construct is detected.\n>     \n>     A badly constructed sentence was corrected in the documentation.\n>     \n>     The test case was changed to use a here document, and the unsupported\n>     comment after an alias was removed from the test case alias file input.\n\nThanks.\n\nA small thing I noticed in the test (and this patch is not adding a\nnew \"breakage\"---there are a few existing instances) is the use of\n\"~/\"; it should be spelled \"$HOME/\" instead for portability (not in\nPOSIX, even though bash, dash and ksh all seem to understand it).\n\nI think this round looks good from a cursory read.\n\nEric, what do you think?\n\n>  Documentation/git-send-email.txt | 37 ++++++++++++++++++++++++++++++++++++-\n>  git-send-email.perl              | 29 +++++++++++++++++++++++++++++\n>  t/t9001-send-email.sh            | 27 +++++++++++++++++++++++++++\n>  3 files changed, 92 insertions(+), 1 deletion(-)\n>\n> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n> index 804554609def..97387fd27a8d 100644\n> --- a/Documentation/git-send-email.txt\n> +++ b/Documentation/git-send-email.txt\n> @@ -383,7 +383,42 @@ sendemail.aliasesFile::\n>  \n>  sendemail.aliasFileType::\n>  \tFormat of the file(s) specified in sendemail.aliasesFile. Must be\n> -\tone of 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.\n> +\tone of 'sendmail', 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.\n> ++\n> +If the format is 'sendmail', then the alias file format is described below.\n> +Descriptions of the other file formats can be found by searching the\n> +documentation of the email program of the same name.\n> ++\n> +The 'sendmail' format is is as follows.  Note that 'git-send-email' currently\n> +only supports a limited subset of the sendmail format.\n> ++\n> +\t<alias>: <address|alias>[, <address|alias>...]\n> ++\n> +Aliases are specified one per line, and must start on the first column of the\n> +line.  Blank lines are ignored.  If the first non whitespace character on a\n> +line is a `#` symbol, then the whole line is considered a comment, and is\n> +ignored.\n> ++\n> +Example of the 'sendmail' format:\n> ++\n> +\talice: Alice W Land <awol@example.com>\n> +\tbob: Robert Bobbyton <bob@example.com>\n> +\t# this is a comment\n> +\t   # this is also a comment\n> +\tchloe: chloe@example.com\n> +\tabgroup: alice, bob\n> +\tbcgrp: bob, chloe, Other <o@example.com>\n> ++\n> +Unlike the standard sendmail format, 'git-send-email' currently diverges in the\n> +following ways.\n> ++\n> +*\tQuoted aliases and quoted addresses are not supported: lines that\n> +\tcontain a `\"` symbol are ignored.\n> +*\tLine continuations are not supported: any lines that start with\n> +\twhitespace, or end with a `\\` symbol are ignored.\n> +*\tWarnings are printed on the standard error output for any explicitly\n> +\tunsupported constructs, and any other lines that are not recognized\n> +\tby the parser.\n>  \n>  sendemail.multiEdit::\n>  \tIf true (default), a single editor instance will be spawned to edit\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index e1e9b1460ced..ffea50094a48 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -487,6 +487,8 @@ sub split_addrs {\n>  }\n>  \n>  my %aliases;\n> +\n> +\n>  my %parse_alias = (\n>  \t# multiline formats can be supported in the future\n>  \tmutt => sub { my $fh = shift; while (<$fh>) {\n> @@ -516,6 +518,33 @@ my %parse_alias = (\n>  \t\t\t  }\n>  \t\t      } },\n>  \n> +\tsendmail => sub { my $fh = shift; while (<$fh>) {\n> +\t\t# ignore comment lines\n> +\t\tif (/^\\s*(?:#.*)?$/) { }\n> +\n> +\t\t# warn on lines that contain quotes\n> +\t\telsif (/\"/) {\n> +\t\t\tprint STDERR \"sendmail alias with quotes is not supported: $_\\n\";\n> +\t\t\tnext;\n> +\t\t}\n> +\n> +\t\t# warn on lines that continue\n> +\t\telsif (/^\\s|\\\\$/) {\n> +\t\t\tprint STDERR \"sendmail continuation line is not supported: $_\\n\";\n> +\t\t\tnext;\n> +\t\t}\n> +\n> +\t\t# recognize lines that look like an alias\n> +\t\telsif (/^(\\S+)\\s*:\\s*(.+?)$/) {\n> +\t\t\tmy ($alias, $addr) = ($1, $2);\n> +\t\t\t$aliases{$alias} = [ split_addrs($addr) ];\n> +\t\t}\n> +\n> +\t\t# warn on lines that are not recognized\n> +\t\telse {\n> +\t\t\tprint STDERR \"sendmail line is not recognized: $_\\n\";\n> +\t\t}}},\n> +\n>  \tgnus => sub { my $fh = shift; while (<$fh>) {\n>  \t\tif (/\\(define-mail-alias\\s+\"(\\S+?)\"\\s+\"(\\S+?)\"\\)/) {\n>  \t\t\t$aliases{$1} = [ $2 ];\n> diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\n> index 7be14a4e37f7..b04d26364767 100755\n> --- a/t/t9001-send-email.sh\n> +++ b/t/t9001-send-email.sh\n> @@ -1549,6 +1549,33 @@ test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '\n>  \tgrep \"^!someone@example\\.org!$\" commandline1\n>  '\n>  \n> +test_expect_success $PREREQ 'sendemail.aliasfiletype=sendmail' '\n> +\tclean_fake_sendmail && rm -fr outdir &&\n> +\tgit format-patch -1 -o outdir &&\n> +\tcat >>~/.tmp-email-aliases <<-\\EOF &&\n> +\talice: Alice W Land <awol@example.com>\n> +\tbob: Robert Bobbyton <bob@example.com>\n> +\t# this is a comment\n> +\t   # this is also a comment\n> +\tchloe: chloe@example.com\n> +\tabgroup: alice, bob\n> +\tbcgrp: bob, chloe, Other <o@example.com>\n> +\tEOF\n> +\tgit config --replace-all sendemail.aliasesfile \\\n> +\t\t\"$(pwd)/.tmp-email-aliases\" &&\n> +\tgit config sendemail.aliasfiletype sendmail &&\n> +\tgit send-email \\\n> +\t\t--from=\"Example <nobody@example.com>\" \\\n> +\t\t--to=alice --to=bcgrp \\\n> +\t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n> +\t\toutdir/0001-*.patch \\\n> +\t\t2>errors >out &&\n> +\tgrep \"^!awol@example\\.com!$\" commandline1 &&\n> +\tgrep \"^!bob@example\\.com!$\" commandline1 &&\n> +\tgrep \"^!chloe@example\\.com!$\" commandline1 &&\n> +\tgrep \"^!o@example\\.com!$\" commandline1\n> +'\n> +\n>  do_xmailer_test () {\n>  \texpected=$1 params=$2 &&\n>  \tgit format-patch -1 &&\n"},{"id":"262002","messageId":"xmqq7frzcgx2.fsf@gitster.dls.corp.google.com","threadId":"39416","inReplyTo":"xmqqfv6nchmf.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-23T18:00:57Z","receivedAt":"2015-05-23T18:00:57Z","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>> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n>> index 804554609def..97387fd27a8d 100644\n>> --- a/Documentation/git-send-email.txt\n>> +++ b/Documentation/git-send-email.txt\n>> @@ -383,7 +383,42 @@ sendemail.aliasesFile::\n>>  \n>>  sendemail.aliasFileType::\n>>  \tFormat of the file(s) specified in sendemail.aliasesFile. Must be\n>> -\tone of 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.\n>> +\tone of 'sendmail', 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.\n\nWe prefer to append to an existing list of equals, not prepend.\n\n>> ++\n>> +If the format is 'sendmail', then the alias file format is described below.\n>> +Descriptions of the other file formats can be found by searching the\n>> +documentation of the email program of the same name.\n\nThe phrasing feels somewhat awkward.  How about dropping the first\nline, pretending as if 'sendmail' is also fully 'sendmail' format,\nand then describe the limitations (like you already did below)?  I\nhave a feeling that other formats have similar limitations (e.g. I\ndo not think piping to commands in any other formats would be\nsupported by send-email), and other people can follow suit and\ndescribe the limitations.\n\nThat is, drop the paragraph that describes the basics (which can be\nlearned by searching the documentation of the email program of the\nsame name), and dive right into the differences.\n\nIOW,\n\n\tWhat an alias file in each format looks like can be found in\n\tthe documentation of the email program of the same name. The\n\tdifferences and limitations from the standard formats are\n\tdescribed below:\n        +\n\t--\n        sendmail;;\n>> +*\tQuoted aliases and quoted addresses are not supported: lines that\n>> +\tcontain a `\"` symbol are ignored.\n>> +*\tLine continuations are not supported: any lines that start with\n>> +\twhitespace, or end with a `\\` symbol are ignored.\n>> +*\tWarnings are printed on the standard error output for any explicitly\n>> +\tunsupported constructs, and any other lines that are not recognized\n>> +\tby the parser.\n\t--\n\nThat way, limitations and deviations of other formats can be added\nlater in a consistent way.\n\nJust a thought.\n"},{"id":"262003","messageId":"xmqq382ncgmb.fsf@gitster.dls.corp.google.com","threadId":"39416","inReplyTo":"xmqqfv6nchmf.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-23T18:07:24Z","receivedAt":"2015-05-23T18:07:24Z","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> A small thing I noticed in the test (and this patch is not adding a\n> new \"breakage\"---there are a few existing instances) is the use of\n> \"~/\"; it should be spelled \"$HOME/\" instead for portability (not in\n> POSIX, even though bash, dash and ksh all seem to understand it).\n\nWell, I was wrong. Tilde expansion is in POSIX.\n\nNevertheless, I'd prefer if we avoided it.\n"},{"id":"262006","messageId":"CAJ80savVjb3_iKhNWPjQNK72DL7eq5YkbjWWG-1Gkx5+LOjzeg@mail.gmail.com","threadId":"39416","inReplyTo":"xmqq382ncgmb.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Allen Hubbe","fromEmail":"allenbh@gmail.com","sentAt":"2015-05-23T22:24:52Z","receivedAt":"2015-05-23T22:24:52Z","isPatch":true,"sender":{"key":"allenbh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/812915?v=4"},"body":"On Sat, May 23, 2015 at 2:07 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> A small thing I noticed in the test (and this patch is not adding a\n>> new \"breakage\"---there are a few existing instances) is the use of\n>> \"~/\"; it should be spelled \"$HOME/\" instead for portability (not in\n>> POSIX, even though bash, dash and ksh all seem to understand it).\n>\n> Well, I was wrong. Tilde expansion is in POSIX.\n>\n> Nevertheless, I'd prefer if we avoided it.\n\nAlright, $HOME it will be.\n"},{"id":"262008","messageId":"CAJ80savjia5ywQcUzGidBx=Jb378YjYT=ZdBt5hQ6WdReTLj0g@mail.gmail.com","threadId":"39416","inReplyTo":"xmqq7frzcgx2.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Allen Hubbe","fromEmail":"allenbh@gmail.com","sentAt":"2015-05-23T23:01:01Z","receivedAt":"2015-05-23T23:01:01Z","isPatch":true,"sender":{"key":"allenbh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/812915?v=4"},"body":"On Sat, May 23, 2015 at 2:00 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>>> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n>>> index 804554609def..97387fd27a8d 100644\n>>> --- a/Documentation/git-send-email.txt\n>>> +++ b/Documentation/git-send-email.txt\n>>> @@ -383,7 +383,42 @@ sendemail.aliasesFile::\n>>>\n>>>  sendemail.aliasFileType::\n>>>      Format of the file(s) specified in sendemail.aliasesFile. Must be\n>>> -    one of 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.\n>>> +    one of 'sendmail', 'mutt', 'mailrc', 'pine', 'elm', or 'gnus'.\n>\n> We prefer to append to an existing list of equals, not prepend.\n>\n\nI initially thought to put it last, too.  I'll move it back to the end.\n\nI moved it to the beginning, because it seemed odd to me for only the\nlast thing in the list to have a further description.  If the intent\nis that eventually (perhaps in an ideal world), the other formats will\nhave expanded documentation, too, then you are right that adding new\nthings to the end makes the most sense.\n\n>>> ++\n>>> +If the format is 'sendmail', then the alias file format is described below.\n>>> +Descriptions of the other file formats can be found by searching the\n>>> +documentation of the email program of the same name.\n>\n> The phrasing feels somewhat awkward.  How about dropping the first\n> line, pretending as if 'sendmail' is also fully 'sendmail' format,\n> and then describe the limitations (like you already did below)?  I\n> have a feeling that other formats have similar limitations (e.g. I\n> do not think piping to commands in any other formats would be\n> supported by send-email), and other people can follow suit and\n> describe the limitations.\n>\n> That is, drop the paragraph that describes the basics (which can be\n> learned by searching the documentation of the email program of the\n> same name), and dive right into the differences.\n>\n> IOW,\n>\n>         What an alias file in each format looks like can be found in\n>         the documentation of the email program of the same name. The\n>         differences and limitations from the standard formats are\n>         described below:\n>         +\n>         --\n>         sendmail;;\n>>> +*   Quoted aliases and quoted addresses are not supported: lines that\n>>> +    contain a `\"` symbol are ignored.\n>>> +*   Line continuations are not supported: any lines that start with\n>>> +    whitespace, or end with a `\\` symbol are ignored.\n>>> +*   Warnings are printed on the standard error output for any explicitly\n>>> +    unsupported constructs, and any other lines that are not recognized\n>>> +    by the parser.\n>         --\n\nAlright.\n\nThanks for showing me '--'.  I had some trouble with asciidoc, where\nmy intention was to insert a bulleted list between two paragraphs in a\ncontaining definition-list item.  The paragraph that I intended to be\nafter the bulleted list was instead nested in the last bulleted item\nin the list.\n\nThe documentation for asciidoc soesn't seem to be very helpful in\ndescribing this construct.  There is one example, that I could find,\nand I didn't find a description of the syntax for it.  Perhaps I\nmissed it among all the other uses of a series of '-'.  I don't see\nany way for this to distinguish between different levels of nesting,\nlike a block of --/-- in another block of --/--; that might be\nsyntactically indistinguishable from a block of --/-- followed by\nanother block of --/--.\n\n>\n> That way, limitations and deviations of other formats can be added\n> later in a consistent way.\n>\n> Just a thought.\n"},{"id":"262026","messageId":"CAJ80sas_D-6z4MvuFvvjoX7U_bM6b3brCo4rvYFCUfTmKS=6bA@mail.gmail.com","threadId":"39416","inReplyTo":"CAJ80savVjb3_iKhNWPjQNK72DL7eq5YkbjWWG-1Gkx5+LOjzeg@mail.gmail.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Allen Hubbe","fromEmail":"allenbh@gmail.com","sentAt":"2015-05-25T12:47:32Z","receivedAt":"2015-05-25T12:47:32Z","isPatch":true,"sender":{"key":"allenbh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/812915?v=4"},"body":"On Sat, May 23, 2015 at 6:24 PM, Allen Hubbe <allenbh@gmail.com> wrote:\n> On Sat, May 23, 2015 at 2:07 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Junio C Hamano <gitster@pobox.com> writes:\n>>\n>>> A small thing I noticed in the test (and this patch is not adding a\n>>> new \"breakage\"---there are a few existing instances) is the use of\n>>> \"~/\"; it should be spelled \"$HOME/\" instead for portability (not in\n>>> POSIX, even though bash, dash and ksh all seem to understand it).\n>>\n>> Well, I was wrong. Tilde expansion is in POSIX.\n>>\n>> Nevertheless, I'd prefer if we avoided it.\n>\n> Alright, $HOME it will be.\n\nLooking closer at this and the other test cases, they are inconsistent\nabout using \".mailrc\", \"~/.mailrc\", and \"$(pwd)/.mailrc\".  This would\nadd another one, \"$HOME/.mailrc\".\n\nHow do you feel about using just \".mailrc\", and \"$(pwd)/.mailrc\" when\nan absolute path is needed in gitconfig?\n"},{"id":"262031","messageId":"xmqqpp5obotk.fsf@gitster.dls.corp.google.com","threadId":"39416","inReplyTo":"CAJ80sas_D-6z4MvuFvvjoX7U_bM6b3brCo4rvYFCUfTmKS=6bA@mail.gmail.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-25T16:32:23Z","receivedAt":"2015-05-25T16:32:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Allen Hubbe <allenbh@gmail.com> writes:\n\n> Looking closer at this and the other test cases, they are inconsistent\n> about using \".mailrc\", \"~/.mailrc\", and \"$(pwd)/.mailrc\".  This would\n> add another one, \"$HOME/.mailrc\".\n\nIn t9001, I see two tests on mailrc:\n\n * Create .mailrc in the current directory and point at it from the\n   configuration file sendemail.aliasfile with $(pwd)/.mailrc\n\n   This one is correct in that test wants to make sure an absolute\n   path is usable as the value; the creation in the current\n   directory (hence >.mailrc) is a mere implementation detail that\n   the file it wants to use can be created by pathname relative to\n   the current directory when \"echo\" is run.\n\n * Create ~/.mailrc, relying on tilde expansion of the shell when\n   \"echo\" is run, and then point at it from the configuration file\n   as \"~/.mailrc\".\n\n   The former, i.e. \"echo ... >~/.mailrc\" should instead redirect\n   into >$HOME/.mailrc in order to support shells that do not\n   understand tilde expansion.  However, the latter is correct, as\n   this test wants to make sure that whoever reads the configuration\n   interprets ~/.mailrc as \"file .mailrc in the home directory\",\n   without help from the shell.\n\nSpecifically, the difference between these two tests is not\ninconcistency; they are covering two different use patterns.\n\nSo I do not see any reason to change most of these; except that the\ntarget of 'echo' should be changed from ~/.mailrc to $HOME/.mailrc.\n\nThanks.\n"},{"id":"262096","messageId":"xmqq1ti4bbu0.fsf@gitster.dls.corp.google.com","threadId":"39416","inReplyTo":"xmqqpp5obotk.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-25T21:12:55Z","receivedAt":"2015-05-25T21:12:55Z","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> Allen Hubbe <allenbh@gmail.com> writes:\n>\n>> Looking closer at this and the other test cases, they are inconsistent\n>> about using \".mailrc\", \"~/.mailrc\", and \"$(pwd)/.mailrc\".  This would\n>> add another one, \"$HOME/.mailrc\".\n>\n> In t9001, I see two tests on mailrc:\n> ...\n> So I do not see any reason to change most of these; except that the\n> target of 'echo' should be changed from ~/.mailrc to $HOME/.mailrc.\n\nFYI, I have tentatively queued this on top of your patch.  Please\nsee \"git log master..cf954075\" to double check.\n\nThanks.\n\n-- >8 --\n\nSubject: [PATCH] t9001: write $HOME/, not ~/, to help shells without tilde expansion\n\nEven though it is in POSIX, we do not have to use it, only to hurt\nshells that may lack the support.\n\nThe .mailrc test tries to define an alias in .mailrc in the home\ndirectory by shell redirection, and then tries to see ~/.mailrc in\nconfig is tilde-expanded by Git without help from shell.  So the\ncreation should become $HOME/ to be portable for shells that may\nlack tilde expansion but the reference should be done as \"~/.mailrc\".\n\nThe sendmail one refers to the file from the configuration with full\npath, so it does not need to know that $HOME during the test run is\nset to the current \"trash\" directory.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t9001-send-email.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex b04d263..c5c6867 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -1537,7 +1537,7 @@ test_expect_success $PREREQ 'sendemail.aliasfiletype=mailrc' '\n \n test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '\n \tclean_fake_sendmail &&\n-\techo \"alias sbd  someone@example.org\" >~/.mailrc &&\n+\techo \"alias sbd  someone@example.org\" >\"$HOME/.mailrc\" &&\n \tgit config --replace-all sendemail.aliasesfile \"~/.mailrc\" &&\n \tgit config sendemail.aliasfiletype mailrc &&\n \tgit send-email \\\n@@ -1552,7 +1552,7 @@ test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '\n test_expect_success $PREREQ 'sendemail.aliasfiletype=sendmail' '\n \tclean_fake_sendmail && rm -fr outdir &&\n \tgit format-patch -1 -o outdir &&\n-\tcat >>~/.tmp-email-aliases <<-\\EOF &&\n+\tcat >>./.tmp-email-aliases\" <<-\\EOF &&\n \talice: Alice W Land <awol@example.com>\n \tbob: Robert Bobbyton <bob@example.com>\n \t# this is a comment\n-- \n2.4.1-455-ga49e496\n"},{"id":"262097","messageId":"xmqqtwv09w84.fsf@gitster.dls.corp.google.com","threadId":"39416","inReplyTo":"xmqq1ti4bbu0.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-25T21:35:23Z","receivedAt":"2015-05-25T21:35:23Z","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> Junio C Hamano <gitster@pobox.com> writes:\n>\n> FYI, I have tentatively queued this on top of your patch.  Please\n> see \"git log master..cf954075\" to double check.\n\nSorry but I had a typo there...\n\n>  \tgit format-patch -1 -o outdir &&\n> -\tcat >>~/.tmp-email-aliases <<-\\EOF &&\n> +\tcat >>./.tmp-email-aliases\" <<-\\EOF &&\n\nThis should just be\n\n\tcat >>.tmp-email-aliases <<-\\EOF &&\n"},{"id":"262104","messageId":"CAJ80sauXaaOjQhybxWVrHJpNQhHCKOd2Le1vFqEwBef6gYjqrQ@mail.gmail.com","threadId":"39416","inReplyTo":"xmqqtwv09w84.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Allen Hubbe","fromEmail":"allenbh@gmail.com","sentAt":"2015-05-26T01:51:58Z","receivedAt":"2015-05-26T01:51:58Z","isPatch":true,"sender":{"key":"allenbh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/812915?v=4"},"body":"On Mon, May 25, 2015 at 5:35 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Junio C Hamano <gitster@pobox.com> writes:\n>>\n>> FYI, I have tentatively queued this on top of your patch.  Please\n>> see \"git log master..cf954075\" to double check.\n>\n> Sorry but I had a typo there...\n>\n>>       git format-patch -1 -o outdir &&\n>> -     cat >>~/.tmp-email-aliases <<-\\EOF &&\n>> +     cat >>./.tmp-email-aliases\" <<-\\EOF &&\n>\n> This should just be\n>\n>         cat >>.tmp-email-aliases <<-\\EOF &&\n>\n\nThanks for letting me know.  Are you still expecting v6 from me then?\nThe other thing you asked for was a change in the documentation: just\nmention the email programs' documentation, and describe the\nexceptions.\n"},{"id":"262105","messageId":"xmqq1ti49k1a.fsf@gitster.dls.corp.google.com","threadId":"39416","inReplyTo":"CAJ80sauXaaOjQhybxWVrHJpNQhHCKOd2Le1vFqEwBef6gYjqrQ@mail.gmail.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-26T01:58:41Z","receivedAt":"2015-05-26T01:58:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Allen Hubbe <allenbh@gmail.com> writes:\n\n> Thanks for letting me know.  Are you still expecting v6 from me then?\n> The other thing you asked for was a change in the documentation: just\n> mention the email programs' documentation, and describe the\n> exceptions.\n\nCould you fetch from me and then run:\n\n $ git log --reverse -3 -p 6b733ee4ba330e1187017895b8426dd9171c33b8\n\nto see if you agree with the result?  That is what I queued on 'pu'\nfor now with my fixups.\n\nWe have not heard from Eric on this round yet, so he (and others)\nmay have further input, but as far as I am concerned, that one\nlooked more or less ready to be merged down to 'next', except for\nthe documentation part, which I haven't had a chance to look at the\nresults and may need further AsciiDoc mark-up fixes.\n\nThanks.\n"},{"id":"262107","messageId":"CAJ80sauoB-quepDf2V=-WqewzJ_nN+ALA-z-vcL_4c8rObxpBg@mail.gmail.com","threadId":"39416","inReplyTo":"xmqq1ti49k1a.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Allen Hubbe","fromEmail":"allenbh@gmail.com","sentAt":"2015-05-26T02:16:36Z","receivedAt":"2015-05-26T02:16:36Z","isPatch":true,"sender":{"key":"allenbh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/812915?v=4"},"body":"On Mon, May 25, 2015 at 9:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Allen Hubbe <allenbh@gmail.com> writes:\n>\n>> Thanks for letting me know.  Are you still expecting v6 from me then?\n>> The other thing you asked for was a change in the documentation: just\n>> mention the email programs' documentation, and describe the\n>> exceptions.\n>\n> Could you fetch from me and then run:\n>\n>  $ git log --reverse -3 -p 6b733ee4ba330e1187017895b8426dd9171c33b8\n>\n> to see if you agree with the result?  That is what I queued on 'pu'\n> for now with my fixups.\n\nIt looks good to me.  How would you like me to proceed?  I assume you\nwould like your patch on top of mine will stay, to use HOME instead of\ntilde.  Or, would you like me to use HOME in my v6, too?\n\nShould I send you v6 like v5, but with the documentation fixed, or\nwould you now prefer a separate patch on top of that to fix the\ndocumentation?  I can do either, and you would be welcome to\nrebase/fixup the second patch into the earlier one with my sign off.\n\n>\n> We have not heard from Eric on this round yet, so he (and others)\n> may have further input, but as far as I am concerned, that one\n> looked more or less ready to be merged down to 'next', except for\n> the documentation part, which I haven't had a chance to look at the\n> results and may need further AsciiDoc mark-up fixes.\n>\n> Thanks.\n"},{"id":"262110","messageId":"xmqqwpzw82ts.fsf@gitster.dls.corp.google.com","threadId":"39416","inReplyTo":"CAJ80sauoB-quepDf2V=-WqewzJ_nN+ALA-z-vcL_4c8rObxpBg@mail.gmail.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-26T02:55:43Z","receivedAt":"2015-05-26T02:55:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Allen Hubbe <allenbh@gmail.com> writes:\n\n>> Could you fetch from me and then run:\n>>\n>>  $ git log --reverse -3 -p 6b733ee4ba330e1187017895b8426dd9171c33b8\n>>\n>> to see if you agree with the result?  That is what I queued on 'pu'\n>> for now with my fixups.\n>\n> It looks good to me.  How would you like me to proceed?  I assume you\n> would like your patch on top of mine will stay, to use HOME instead of\n> tilde.  Or, would you like me to use HOME in my v6, too?\n>\n> Should I send you v6 like v5, but with the documentation fixed, or\n> would you now prefer a separate patch on top of that to fix the\n> documentation?\n\nIt probably should be two patches.  Your sendmail thing with docs\nand tests as one patch (with $HOME in test), and fix to mailrc tests\nI did (minus the part that fixes your sendmail test, which should\nnow become unnecessary) on top.\n\nIf the documentation I queued on 'pu' formats well already (which I\ncannot check myself until tomorrow), then I'd guess the above would\nbe like squashing 8b8fb5a into dc6183c and then 6b733ee on top, I\nthink.\n\n 6b733ee t9001: write $HOME/, not ~/, to help shells without tilde expansion\n 8b8fb5a git-send-email doc: refer to upstream document for alias format\n dc6183c send-email: add sendmail email aliases format\n"},{"id":"262112","messageId":"xmqqoal8811t.fsf@gitster.dls.corp.google.com","threadId":"39416","inReplyTo":"xmqqwpzw82ts.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-26T03:34:06Z","receivedAt":"2015-05-26T03:34:06Z","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> It probably should be two patches.  Your sendmail thing with docs\n> and tests as one patch (with $HOME in test), and fix to mailrc tests\n> I did (minus the part that fixes your sendmail test, which should\n> now become unnecessary) on top.\n>\n> If the documentation I queued on 'pu' formats well already (which I\n> cannot check myself until tomorrow), then I'd guess the above would\n> be like squashing 8b8fb5a into dc6183c and then 6b733ee on top, I\n> think.\n>\n>  6b733ee t9001: write $HOME/, not ~/, to help shells without tilde expansion\n>  8b8fb5a git-send-email doc: refer to upstream document for alias format\n>  dc6183c send-email: add sendmail email aliases format\n\nWell, I lied [*1*].  I think the documentation part of what is in\n'pu' formats fine, so let me just clean them up and push the result\nout for your final review.  Give me a few hours (leaving time for\ndinner and etc., too).\n\n[Footnote]\n\n*1* My Git time is spent on in a terminal-only environment, a\nvirtual machine running somewhere in Google datacenters, and when I\nam home working from a Chromebook via ssh, I lack a convenient way\nto grab a single file out of there to view in the browser locally.\nThe virtual machine does let me upload to Google Drive and I can\ngrab a file from there to my Chromebook, and that is what I did to\nsee what the AsciiDoc formatted result looked like just now ;-)\n"},{"id":"262148","messageId":"CAPig+cT3-=05xpeBUMEo3cT8-i=EQKv=XD7cKPDPuLbsfQX2=g@mail.gmail.com","threadId":"39416","inReplyTo":"xmqqfv6nchmf.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-05-26T18:47:28Z","receivedAt":"2015-05-26T18:47:28Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, May 23, 2015 at 1:45 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Allen Hubbe <allenbh@gmail.com> writes:\n>> Note that this only adds support for a limited subset of the sendmail\n>> format.  The format is is as follows.\n>>\n>>       <alias>: <address|alias>[, <address|alias>...]\n>>\n>> Aliases are specified one per line, and must start on the first column of the\n>> line.  Blank lines are ignored.  If the first non whitespace character\n>> on a line is a '#' symbol, then the whole line is considered a comment,\n>> and is ignored.\n>> [...]\n>> Signed-off-by: Allen Hubbe <allenbh@gmail.com>\n>> ---\n>\n> Thanks.\n>\n> A small thing I noticed in the test (and this patch is not adding a\n> new \"breakage\"---there are a few existing instances) is the use of\n> \"~/\"; it should be spelled \"$HOME/\" instead for portability (not in\n> POSIX, even though bash, dash and ksh all seem to understand it).\n>\n> I think this round looks good from a cursory read.\n>\n> Eric, what do you think?\n\nSorry for the delay. This round looks much better. I do have a few\nvery minor comments, which I'll post in reply to the patch itself, but\nnothing worth holding the series up. Thanks.\n"},{"id":"262149","messageId":"CAPig+cTaiZ_PVaGk6n_bsEqqTJEYEMSCWcnC0=MiN2Bf7L4sWw@mail.gmail.com","threadId":"39416","inReplyTo":"49e9a95b52aa61ed4f37edf1dfa178186acb4a29.1432367540.git.allenbh@gmail.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-05-26T19:10:03Z","receivedAt":"2015-05-26T19:10:03Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Saturday, May 23, 2015, Allen Hubbe <allenbh@gmail.com> wrote:\n> Note that this only adds support for a limited subset of the sendmail\n> format.  The format is is as follows.\n>\n>         <alias>: <address|alias>[, <address|alias>...]\n>\n> Aliases are specified one per line, and must start on the first column of the\n> line.  Blank lines are ignored.  If the first non whitespace character\n> on a line is a '#' symbol, then the whole line is considered a comment,\n> and is ignored.\n> [...]\n> Signed-off-by: Allen Hubbe <allenbh@gmail.com>\n> ---\n>\n> Notes:\n>     This v5 renames the parser 'sendmail' again, from 'simple'.\n>     Therefore, the subject line is changed again, too.\n>\n>     Previous subject line: send-email: Add simple email aliases format\n>\n>     The format is restricted to a subset of sendmail.  When the subset\n>     diverges from sendmail, the parser warns about the line that diverges,\n>     and ignores the line.  The supported format is described in the\n>     documentation, as well as the behavior when an unsupported format\n>     construct is detected.\n>\n>     A badly constructed sentence was corrected in the documentation.\n>\n>     The test case was changed to use a here document, and the unsupported\n>     comment after an alias was removed from the test case alias file input.\n\nThanks. This round looks much nicer. A few minor comments below...\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index e1e9b1460ced..ffea50094a48 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -487,6 +487,8 @@ sub split_addrs {\n>  }\n>\n>  my %aliases;\n> +\n> +\n\nUnnecessary whitespace change sneaked in.\n\n>  my %parse_alias = (\n>         # multiline formats can be supported in the future\n>         mutt => sub { my $fh = shift; while (<$fh>) {\n> @@ -516,6 +518,33 @@ my %parse_alias = (\n>                           }\n>                       } },\n>\n> +       sendmail => sub { my $fh = shift; while (<$fh>) {\n> +               # ignore comment lines\n> +               if (/^\\s*(?:#.*)?$/) { }\n\nThis confused me at first because the comment talks only about\n\"comment lines\", for which a simpler /^\\s*#/ would suffice. The regex,\nhowever, actually matches blank lines and comment lines (both of which\nget skipped). Either the comment should be fixed or the regex could be\nsplit into two much simpler ones. The splitting into simpler regex's\nhas the benefit of being easier to comprehend at a glance. For\ninstance:\n\n    next if /^\\s*$/;\n    next if /^\\s*#/;\n\nSpeaking of 'next', its use here is inconsistent. Due to use of the\nif/elsif/else chain, 'next' is not needed at all, yet it is used for\nsome cases but not others. To be consistent, either use it everywhere\nor nowhere.\n\n> +               # warn on lines that contain quotes\n> +               elsif (/\"/) {\n> +                       print STDERR \"sendmail alias with quotes is not supported: $_\\n\";\n> +                       next;\n> +               }\n> +\n> +               # warn on lines that continue\n> +               elsif (/^\\s|\\\\$/) {\n> +                       print STDERR \"sendmail continuation line is not supported: $_\\n\";\n> +                       next;\n> +               }\n> +\n> +               # recognize lines that look like an alias\n> +               elsif (/^(\\S+)\\s*:\\s*(.+?)$/) {\n\nObservation: Given \"foo:bar:baz\", this regex will take \"foo:bar\" as\nthe key, and \"baz\" as the value, which is probably not what was\nintended, however, it likely doesn't matter much in this case since\ncolon isn't legal in an email address[1].\n\n[1]: However, I could have sworn that colon was legal in some type of\nemail address years ago, but I can no longer remember which type it\nwas. UUCP used '!' in email addresses, so that wasn't it.\n\n> +                       my ($alias, $addr) = ($1, $2);\n> +                       $aliases{$alias} = [ split_addrs($addr) ];\n> +               }\n> +\n> +               # warn on lines that are not recognized\n> +               else {\n> +                       print STDERR \"sendmail line is not recognized: $_\\n\";\n> +               }}},\n> +\n>         gnus => sub { my $fh = shift; while (<$fh>) {\n>                 if (/\\(define-mail-alias\\s+\"(\\S+?)\"\\s+\"(\\S+?)\"\\)/) {\n>                         $aliases{$1} = [ $2 ];\n"},{"id":"262151","messageId":"CAJ80sasp6kNgbJJw-2TzZnPPDVgYdAwwsdh=hNH4xxu1TBtiyA@mail.gmail.com","threadId":"39416","inReplyTo":"CAPig+cTaiZ_PVaGk6n_bsEqqTJEYEMSCWcnC0=MiN2Bf7L4sWw@mail.gmail.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Allen Hubbe","fromEmail":"allenbh@gmail.com","sentAt":"2015-05-26T19:41:35Z","receivedAt":"2015-05-26T19:41:35Z","isPatch":true,"sender":{"key":"allenbh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/812915?v=4"},"body":"On Tue, May 26, 2015 at 3:10 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n> On Saturday, May 23, 2015, Allen Hubbe <allenbh@gmail.com> wrote:\n>> Note that this only adds support for a limited subset of the sendmail\n>> format.  The format is is as follows.\n>>\n>>         <alias>: <address|alias>[, <address|alias>...]\n>>\n>> Aliases are specified one per line, and must start on the first column of the\n>> line.  Blank lines are ignored.  If the first non whitespace character\n>> on a line is a '#' symbol, then the whole line is considered a comment,\n>> and is ignored.\n>> [...]\n>> Signed-off-by: Allen Hubbe <allenbh@gmail.com>\n>> ---\n>>\n>> Notes:\n>>     This v5 renames the parser 'sendmail' again, from 'simple'.\n>>     Therefore, the subject line is changed again, too.\n>>\n>>     Previous subject line: send-email: Add simple email aliases format\n>>\n>>     The format is restricted to a subset of sendmail.  When the subset\n>>     diverges from sendmail, the parser warns about the line that diverges,\n>>     and ignores the line.  The supported format is described in the\n>>     documentation, as well as the behavior when an unsupported format\n>>     construct is detected.\n>>\n>>     A badly constructed sentence was corrected in the documentation.\n>>\n>>     The test case was changed to use a here document, and the unsupported\n>>     comment after an alias was removed from the test case alias file input.\n>\n> Thanks. This round looks much nicer. A few minor comments below...\n>\n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index e1e9b1460ced..ffea50094a48 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -487,6 +487,8 @@ sub split_addrs {\n>>  }\n>>\n>>  my %aliases;\n>> +\n>> +\n>\n> Unnecessary whitespace change sneaked in.\n>\n>>  my %parse_alias = (\n>>         # multiline formats can be supported in the future\n>>         mutt => sub { my $fh = shift; while (<$fh>) {\n>> @@ -516,6 +518,33 @@ my %parse_alias = (\n>>                           }\n>>                       } },\n>>\n>> +       sendmail => sub { my $fh = shift; while (<$fh>) {\n>> +               # ignore comment lines\n>> +               if (/^\\s*(?:#.*)?$/) { }\n>\n> This confused me at first because the comment talks only about\n> \"comment lines\", for which a simpler /^\\s*#/ would suffice. The regex,\n> however, actually matches blank lines and comment lines (both of which\n> get skipped). Either the comment should be fixed or the regex could be\n> split into two much simpler ones. The splitting into simpler regex's\n> has the benefit of being easier to comprehend at a glance. For\n> instance:\n>\n>     next if /^\\s*$/;\n>     next if /^\\s*#/;\n\nI noticed this too after sending the patch, and I have already changed\nthe comment to mention blank lines or comment lines.\n\nSplitting the regex would be more simple, but the regex is already\nquite simple as it is.\n\n>\n> Speaking of 'next', its use here is inconsistent. Due to use of the\n> if/elsif/else chain, 'next' is not needed at all, yet it is used for\n> some cases but not others. To be consistent, either use it everywhere\n> or nowhere.\n\nThese used to be `if (foo) { somthing; next; }` while this version was\nwork in progress, which I changed to elsif with the intention of\nremoving the next.  Thanks for catching the inconsistency.  I will\nremove the next.\n\n>\n>> +               # warn on lines that contain quotes\n>> +               elsif (/\"/) {\n>> +                       print STDERR \"sendmail alias with quotes is not supported: $_\\n\";\n>> +                       next;\n>> +               }\n>> +\n>> +               # warn on lines that continue\n>> +               elsif (/^\\s|\\\\$/) {\n>> +                       print STDERR \"sendmail continuation line is not supported: $_\\n\";\n>> +                       next;\n>> +               }\n>> +\n>> +               # recognize lines that look like an alias\n>> +               elsif (/^(\\S+)\\s*:\\s*(.+?)$/) {\n>\n> Observation: Given \"foo:bar:baz\", this regex will take \"foo:bar\" as\n> the key, and \"baz\" as the value, which is probably not what was\n> intended, however, it likely doesn't matter much in this case since\n> colon isn't legal in an email address[1].\n\nThat's a keen observation.  I think it would work simply to use a\nnon-greedy +? in the first capture group.\n\n>\n> [1]: However, I could have sworn that colon was legal in some type of\n> email address years ago, but I can no longer remember which type it\n> was. UUCP used '!' in email addresses, so that wasn't it.\n>\n>> +                       my ($alias, $addr) = ($1, $2);\n>> +                       $aliases{$alias} = [ split_addrs($addr) ];\n>> +               }\n>> +\n>> +               # warn on lines that are not recognized\n>> +               else {\n>> +                       print STDERR \"sendmail line is not recognized: $_\\n\";\n>> +               }}},\n>> +\n>>         gnus => sub { my $fh = shift; while (<$fh>) {\n>>                 if (/\\(define-mail-alias\\s+\"(\\S+?)\"\\s+\"(\\S+?)\"\\)/) {\n>>                         $aliases{$1} = [ $2 ];\n"},{"id":"262158","messageId":"CAPig+cQoUrAhpvyrBTFyDDjaZt8brkhhw3aehC-hNeS7gND6jw@mail.gmail.com","threadId":"39416","inReplyTo":"CAJ80sasp6kNgbJJw-2TzZnPPDVgYdAwwsdh=hNH4xxu1TBtiyA@mail.gmail.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-05-26T20:53:14Z","receivedAt":"2015-05-26T20:53:14Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, May 26, 2015 at 3:41 PM, Allen Hubbe <allenbh@gmail.com> wrote:\n> On Tue, May 26, 2015 at 3:10 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>> On Saturday, May 23, 2015, Allen Hubbe <allenbh@gmail.com> wrote:\n>>> diff --git a/git-send-email.perl b/git-send-email.perl\n>>> index e1e9b1460ced..ffea50094a48 100755\n>>> --- a/git-send-email.perl\n>>> +++ b/git-send-email.perl\n>>> @@ -516,6 +518,33 @@ my %parse_alias = (\n>>>                           }\n>>>                       } },\n>>>\n>>> +       sendmail => sub { my $fh = shift; while (<$fh>) {\n>>> +               # ignore comment lines\n>>> +               if (/^\\s*(?:#.*)?$/) { }\n>>\n>> This confused me at first because the comment talks only about\n>> \"comment lines\", for which a simpler /^\\s*#/ would suffice. The regex,\n>> however, actually matches blank lines and comment lines (both of which\n>> get skipped). Either the comment should be fixed or the regex could be\n>> split into two much simpler ones. The splitting into simpler regex's\n>> has the benefit of being easier to comprehend at a glance. For\n>> instance:\n>>\n>>     next if /^\\s*$/;\n>>     next if /^\\s*#/;\n>\n> I noticed this too after sending the patch, and I have already changed\n> the comment to mention blank lines or comment lines.\n>\n> Splitting the regex would be more simple, but the regex is already\n> quite simple as it is.\n\nTo be clear, the reason that I brought up the idea of splitting the\nregex was that /^\\s*$/ and /^\\s*#/ are very common idioms which people\ncan and do recognize and understand at-a-glance without having to\nspend time deciphering them. On the other hand, /^\\s*(?:#.*)?$/\ndoesn't lend itself to that sort of instant comprehension; it requires\na certain amount of mental effort to understand.\n\nAnyhow, it's just an idea put forth in case you or someone favors it;\nnot an outright request for a change.\n\n>>> +               # recognize lines that look like an alias\n>>> +               elsif (/^(\\S+)\\s*:\\s*(.+?)$/) {\n>>\n>> Observation: Given \"foo:bar:baz\", this regex will take \"foo:bar\" as\n>> the key, and \"baz\" as the value, which is probably not what was\n>> intended, however, it likely doesn't matter much in this case since\n>> colon isn't legal in an email address[1].\n>\n> That's a keen observation.  I think it would work simply to use a\n> non-greedy +? in the first capture group.\n\nYes, that would work. Alternately: /^([^\\s:]+)\\s*:\\s*(.+?)$/\n"},{"id":"262160","messageId":"CAJ80sau7aO9mSvBCp9TyXqeO4gS=gwsou0eX9CxmzTXcajx6rg@mail.gmail.com","threadId":"39416","inReplyTo":"CAPig+cQoUrAhpvyrBTFyDDjaZt8brkhhw3aehC-hNeS7gND6jw@mail.gmail.com","subject":"Re: [PATCH v5 1/1] send-email: Add sendmail email aliases format","fromName":"Allen Hubbe","fromEmail":"allenbh@gmail.com","sentAt":"2015-05-26T21:04:41Z","receivedAt":"2015-05-26T21:04:41Z","isPatch":true,"sender":{"key":"allenbh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/812915?v=4"},"body":"On Tue, May 26, 2015 at 4:53 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n> On Tue, May 26, 2015 at 3:41 PM, Allen Hubbe <allenbh@gmail.com> wrote:\n>> On Tue, May 26, 2015 at 3:10 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>>> On Saturday, May 23, 2015, Allen Hubbe <allenbh@gmail.com> wrote:\n>>>> +               # recognize lines that look like an alias\n>>>> +               elsif (/^(\\S+)\\s*:\\s*(.+?)$/) {\n>>>\n>>> Observation: Given \"foo:bar:baz\", this regex will take \"foo:bar\" as\n>>> the key, and \"baz\" as the value, which is probably not what was\n>>> intended, however, it likely doesn't matter much in this case since\n>>> colon isn't legal in an email address[1].\n>>\n>> That's a keen observation.  I think it would work simply to use a\n>> non-greedy +? in the first capture group.\n>\n> Yes, that would work. Alternately: /^([^\\s:]+)\\s*:\\s*(.+?)$/\n\nI will use the non-greedy +? because the resulting expression is easier to read.\n\nI will remove the non-greedy +? from the second capture group.  It\nserves no purpose there any more.  It had been there to allow matching\na trailing backslash after the group, but now lines with trailing\nbackslash are ignored entirely before reaching here.\n"}]}