{"thread":{"id":"32078","subject":"[PATCH 0/2] send-email: new series-cc-cmd option","startedAt":"2012-11-11T17:04:21Z","lastAt":"2012-11-13T01:01:59Z","messageCount":11,"participants":["Felipe Contreras","Ramkumar Ramachandra","Joe Perches","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"202890","messageId":"1352653463-1923-1-git-send-email-felipe.contreras@gmail.com","threadId":"32078","inReplyTo":null,"subject":"[PATCH 0/2] send-email: new series-cc-cmd option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-11T17:04:21Z","receivedAt":"2012-11-11T17:04:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"cc-cmd is probably not that useful, what we really want is to make a list of\npeople to Cc on a per-patch-series basis.\n\nThis patch series allows just that.\n\nFelipe Contreras (2):\n  send-email: refactor recipients_cmd()\n  send-email: add series-cc-cmd option\n\n Documentation/git-send-email.txt       |  7 +++++++\n contrib/completion/git-completion.bash |  2 +-\n git-send-email.perl                    | 13 ++++++++++---\n 3 files changed, 18 insertions(+), 4 deletions(-)\n\n-- \n1.8.0\n"},{"id":"202891","messageId":"1352653463-1923-2-git-send-email-felipe.contreras@gmail.com","threadId":"32078","inReplyTo":"1352653463-1923-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 1/2] send-email: refactor recipients_cmd()","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-11T17:04:22Z","receivedAt":"2012-11-11T17:04:22Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"If we pass the full command to run, we should be able to use it in more\nextensible ways--see next patch.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-send-email.perl | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex aea66a0..26d4477 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1373,11 +1373,11 @@ foreach my $t (@files) {\n # Execute a command (e.g. $to_cmd) to get a list of email addresses\n # and return a results array\n sub recipients_cmd {\n-\tmy ($prefix, $what, $cmd, $file) = @_;\n+\tmy ($prefix, $what, $cmd, @args) = @_;\n \n \tmy $sanitized_sender = sanitize_address($sender);\n \tmy @addresses = ();\n-\topen my $fh, \"$cmd \\Q$file\\E |\"\n+\topen my $fh, \"-|\", $cmd, @args\n \t    or die \"($prefix) Could not execute '$cmd'\";\n \twhile (my $address = <$fh>) {\n \t\t$address =~ s/^\\s*//g;\n-- \n1.8.0\n"},{"id":"202892","messageId":"1352653463-1923-3-git-send-email-felipe.contreras@gmail.com","threadId":"32078","inReplyTo":"1352653463-1923-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 2/2] send-email: add series-cc-cmd option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-11T17:04:23Z","receivedAt":"2012-11-11T17:04:23Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"cc-cmd is only per-file, and many times receipients get lost without\nseing the full patch series.\n\nSo, add an option for series-cc-cmd, which receives as an argument\nrev-list options, just like format-patch.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Documentation/git-send-email.txt       | 7 +++++++\n contrib/completion/git-completion.bash | 2 +-\n git-send-email.perl                    | 9 ++++++++-\n 3 files changed, 16 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 3241170..1161d3e 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -218,6 +218,13 @@ Automating\n \tOutput of this command must be single email address per line.\n \tDefault is the value of 'sendemail.cccmd' configuration value.\n \n+--series-cc-cmd=<command>::\n+\tSpecify a command to execute to generate \"Cc:\" entries for the whole\n+\tpatch series.\n+\tThe arguments would be the same rev-list options the user specified.\n+\tOutput of this command must be single email address per line.\n+\tDefault is the value of 'sendemail.seriescccmd' configuration value.\n+\n --[no-]chain-reply-to::\n \tIf this is set, each email will be sent as a reply to the previous\n \temail sent.  If disabled with \"--no-chain-reply-to\", all emails after\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex be800e0..0b04229 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1555,7 +1555,7 @@ _git_send_email ()\n \t\treturn\n \t\t;;\n \t--*)\n-\t\t__gitcomp \"--annotate --bcc --cc --cc-cmd --chain-reply-to\n+\t\t__gitcomp \"--annotate --bcc --cc --cc-cmd --series-cc-cmd --chain-reply-to\n \t\t\t--compose --confirm= --dry-run --envelope-sender\n \t\t\t--from --identity\n \t\t\t--in-reply-to --no-chain-reply-to --no-signed-off-by-cc\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 26d4477..da89ac6 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -191,7 +191,7 @@ sub do_edit {\n \n # Variables with corresponding config settings\n my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc);\n-my ($to_cmd, $cc_cmd);\n+my ($to_cmd, $cc_cmd, $series_cc_cmd);\n my ($smtp_server, $smtp_server_port, @smtp_server_options);\n my ($smtp_authuser, $smtp_encryption);\n my ($identity, $aliasfiletype, @alias_files, $smtp_domain);\n@@ -224,6 +224,7 @@ my %config_settings = (\n     \"tocmd\" => \\$to_cmd,\n     \"cc\" => \\@initial_cc,\n     \"cccmd\" => \\$cc_cmd,\n+    \"seriescccmd\" => \\$series_cc_cmd,\n     \"aliasfiletype\" => \\$aliasfiletype,\n     \"bcc\" => \\@bcclist,\n     \"suppresscc\" => \\@suppress_cc,\n@@ -305,6 +306,7 @@ my $rc = GetOptions(\"h\" => \\$help,\n \t\t    \"compose\" => \\$compose,\n \t\t    \"quiet\" => \\$quiet,\n \t\t    \"cc-cmd=s\" => \\$cc_cmd,\n+\t\t    \"series-cc-cmd=s\" => \\$series_cc_cmd,\n \t\t    \"suppress-from!\" => \\$suppress_from,\n \t\t    \"suppress-cc=s\" => \\@suppress_cc,\n \t\t    \"signed-off-cc|signed-off-by-cc!\" => \\$signed_off_by_cc,\n@@ -766,6 +768,11 @@ if (!@initial_to && !defined $to_cmd) {\n \t$prompting++;\n }\n \n+if (@rev_list_opts) {\n+\tpush @initial_cc, recipients_cmd(\"series-cc-cmd\", \"cc\", $series_cc_cmd, @rev_list_opts)\n+\t\tif defined $series_cc_cmd;\n+}\n+\n sub expand_aliases {\n \treturn map { expand_one_alias($_) } @_;\n }\n-- \n1.8.0\n"},{"id":"203007","messageId":"CALkWK0mRKznNN7750h=k6aE3OJ7hBLVC-G51gEYi2+NuYjPWrQ@mail.gmail.com","threadId":"32078","inReplyTo":"1352653463-1923-3-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 2/2] send-email: add series-cc-cmd option","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-11-12T21:51:17Z","receivedAt":"2012-11-12T21:51:17Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Felipe Contreras wrote:\n> cc-cmd is only per-file, and many times receipients get lost without\n> seing the full patch series.\n\ns/seing/seeing\n\n> [...]\n\nLooks good otherwise.\n\nRam\n"},{"id":"203012","messageId":"1352760759.18715.7.camel@joe-AO722","threadId":"32078","inReplyTo":"CALkWK0mRKznNN7750h=k6aE3OJ7hBLVC-G51gEYi2+NuYjPWrQ@mail.gmail.com","subject":"Re: [PATCH 2/2] send-email: add series-cc-cmd option","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2012-11-12T22:52:39Z","receivedAt":"2012-11-12T22:52:39Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Tue, 2012-11-13 at 03:21 +0530, Ramkumar Ramachandra wrote:\n> Felipe Contreras wrote:\n> > cc-cmd is only per-file, and many times receipients get lost without\n> > seing the full patch series.\n> \n> s/seing/seeing\n> \n> > [...]\n> \n> Looks good otherwise.\n\ns/receipients/recipients/ too\n\nPractically this is ok but I think it's unnecessary.\n\nOutput from git format-patch is always in a single\ndirectory.\n\nMy work flow is to use a script for --to and --cc\nlines that can be set to emit the same addresses for\nall files in a patch series or generate different\naddresses per patch file.\n"},{"id":"203013","messageId":"CAMP44s0B42yt8eugYSjYweoX8WOXXF1f-0N-5FuUyrY5rgCiow@mail.gmail.com","threadId":"32078","inReplyTo":"1352760759.18715.7.camel@joe-AO722","subject":"Re: [PATCH 2/2] send-email: add series-cc-cmd option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-12T23:03:21Z","receivedAt":"2012-11-12T23:03:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Nov 12, 2012 at 11:52 PM, Joe Perches <joe@perches.com> wrote:\n> On Tue, 2012-11-13 at 03:21 +0530, Ramkumar Ramachandra wrote:\n>> Felipe Contreras wrote:\n>> > cc-cmd is only per-file, and many times receipients get lost without\n>> > seing the full patch series.\n>>\n>> s/seing/seeing\n>>\n>> > [...]\n>>\n>> Looks good otherwise.\n>\n> s/receipients/recipients/ too\n>\n> Practically this is ok but I think it's unnecessary.\n>\n> Output from git format-patch is always in a single\n> directory.\n\nA temporary directory.\n\n> My work flow is to use a script for --to and --cc\n> lines that can be set to emit the same addresses for\n> all files in a patch series or generate different\n> addresses per patch file.\n\nFor --to-cmd and --cc-cmd? So basically you check the dirname of the\nargument passed?\n\nWhile that works, it means you have to run the same command multiple\ntimes, one for each mail.\n\nIf the command is using something expensive such as 'git blame' and\nyou have many patches, this is particularly bad. Also, it's not\nelegant :)\n\n-- \nFelipe Contreras\n"},{"id":"203016","messageId":"1352761982.18715.20.camel@joe-AO722","threadId":"32078","inReplyTo":"CAMP44s0B42yt8eugYSjYweoX8WOXXF1f-0N-5FuUyrY5rgCiow@mail.gmail.com","subject":"Re: [PATCH 2/2] send-email: add series-cc-cmd option","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2012-11-12T23:13:02Z","receivedAt":"2012-11-12T23:13:02Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Tue, 2012-11-13 at 00:03 +0100, Felipe Contreras wrote:\n> On Mon, Nov 12, 2012 at 11:52 PM, Joe Perches <joe@perches.com> wrote:\n> > On Tue, 2012-11-13 at 03:21 +0530, Ramkumar Ramachandra wrote:\n> >> Felipe Contreras wrote:\n> >> > cc-cmd is only per-file, and many times receipients get lost without\n> >> > seing the full patch series.\n> >>\n> >> s/seing/seeing\n> >>\n> >> > [...]\n> >>\n> >> Looks good otherwise.\n> >\n> > s/receipients/recipients/ too\n> >\n> > Practically this is ok but I think it's unnecessary.\n> >\n> > Output from git format-patch is always in a single\n> > directory.\n> \n> A temporary directory.\n> \n> > My work flow is to use a script for --to and --cc\n> > lines that can be set to emit the same addresses for\n> > all files in a patch series or generate different\n> > addresses per patch file.\n> \n> For --to-cmd and --cc-cmd? So basically you check the dirname of the\n> argument passed?\n\nyes. basename and dirname\n\n> While that works, it means you have to run the same command multiple\n> times, one for each mail.\n\nShrug.  it's not a generally significant cost.\nThe script could also output the addresses to yet another file.\n\n> If the command is using something expensive such as 'git blame' and\n> you have many patches, this is particularly bad. Also, it's not\n> elegant :)\n\nElegant is a beholder viewpoint.\n\ncheers, Joe\n"},{"id":"203021","messageId":"CAMP44s2EyMcYHYGvxZnj90qD5ms2YZ5O6gXv_TTES0H72vUm0g@mail.gmail.com","threadId":"32078","inReplyTo":"1352761982.18715.20.camel@joe-AO722","subject":"Re: [PATCH 2/2] send-email: add series-cc-cmd option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-12T23:37:38Z","receivedAt":"2012-11-12T23:37:38Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Nov 13, 2012 at 12:13 AM, Joe Perches <joe@perches.com> wrote:\n> On Tue, 2012-11-13 at 00:03 +0100, Felipe Contreras wrote:\n>> On Mon, Nov 12, 2012 at 11:52 PM, Joe Perches <joe@perches.com> wrote:\n>> > On Tue, 2012-11-13 at 03:21 +0530, Ramkumar Ramachandra wrote:\n>> >> Felipe Contreras wrote:\n>> >> > cc-cmd is only per-file, and many times receipients get lost without\n>> >> > seing the full patch series.\n>> >>\n>> >> s/seing/seeing\n>> >>\n>> >> > [...]\n>> >>\n>> >> Looks good otherwise.\n>> >\n>> > s/receipients/recipients/ too\n>> >\n>> > Practically this is ok but I think it's unnecessary.\n>> >\n>> > Output from git format-patch is always in a single\n>> > directory.\n>>\n>> A temporary directory.\n>>\n>> > My work flow is to use a script for --to and --cc\n>> > lines that can be set to emit the same addresses for\n>> > all files in a patch series or generate different\n>> > addresses per patch file.\n>>\n>> For --to-cmd and --cc-cmd? So basically you check the dirname of the\n>> argument passed?\n>\n> yes. basename and dirname\n\nWell, the basename is irrelevant, because you don't care witch\nparticular patch is being sent, you are going to process all of them\nevery time.\n\n>> While that works, it means you have to run the same command multiple\n>> times, one for each mail.\n>\n> Shrug.  it's not a generally significant cost.\n\nIt is when you use 'git blame' and there's a lot of history:\n\n% time git cc-cmd -1 1266686\nPeter Krefting <peter@softwolves.pp.se>\njunio\nTran Ngoc Quan <vnwildman@gmail.com>\nJiang Xin <worldhello.net@gmail.com>\ngit cc-cmd -1 1266686  0.23s user 0.16s system 1% cpu 19.991 total\n\n> The script could also output the addresses to yet another file.\n\nWhich would be even more hacky.\n\n>> If the command is using something expensive such as 'git blame' and\n>> you have many patches, this is particularly bad. Also, it's not\n>> elegant :)\n>\n> Elegant is a beholder viewpoint.\n\nYou think a solution that runs the same instructions multiple times\nunnecessarily is elegant? All right.\n\n-- \nFelipe Contreras\n"},{"id":"203022","messageId":"1352763636.18715.28.camel@joe-AO722","threadId":"32078","inReplyTo":"CAMP44s2EyMcYHYGvxZnj90qD5ms2YZ5O6gXv_TTES0H72vUm0g@mail.gmail.com","subject":"Re: [PATCH 2/2] send-email: add series-cc-cmd option","fromName":"Joe Perches","fromEmail":"joe@perches.com","sentAt":"2012-11-12T23:40:36Z","receivedAt":"2012-11-12T23:40:36Z","isPatch":true,"sender":{"key":"joe@perches.com","avatar":"https://avatars.githubusercontent.com/u/13122723?v=4"},"body":"On Tue, 2012-11-13 at 00:37 +0100, Felipe Contreras wrote:\n> On Tue, Nov 13, 2012 at 12:13 AM, Joe Perches <joe@perches.com> wrote:\n> > On Tue, 2012-11-13 at 00:03 +0100, Felipe Contreras wrote:\n[]\n> >> For --to-cmd and --cc-cmd? So basically you check the dirname of the\n> >> argument passed?\n> >\n> > yes. basename and dirname\n> \n> Well, the basename is irrelevant, because you don't care witch\n> particular patch is being sent, you are going to process all of them\n> every time.\n\nWell, I do different actions on cover letter patches\nthan other patches because for patch sets that touch\nlots of files, the cc list can be _very_ long and\nthat can run afoul of other issues like maximum\nrecipient counts for various mailing lists.\n\ncheers, Joe\n"},{"id":"203027","messageId":"7vd2zigwx6.fsf@alter.siamese.dyndns.org","threadId":"32078","inReplyTo":"1352760759.18715.7.camel@joe-AO722","subject":"Re: [PATCH 2/2] send-email: add series-cc-cmd option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-13T00:37:41Z","receivedAt":"2012-11-13T00:37:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Joe Perches <joe@perches.com> writes:\n\n> On Tue, 2012-11-13 at 03:21 +0530, Ramkumar Ramachandra wrote:\n>> Felipe Contreras wrote:\n>> > cc-cmd is only per-file, and many times receipients get lost without\n>> > seing the full patch series.\n>> \n>> s/seing/seeing\n>> \n>> > [...]\n>> \n>> Looks good otherwise.\n>\n> s/receipients/recipients/ too\n>\n> Practically this is ok but I think it's unnecessary.\n>\n> Output from git format-patch is always in a single\n> directory.\n\nSorry, but I do not see how the usefulness (or necessity) of this\nnew option is connected to the fact that you can tell the command to\nwrite the patches into a single (possibly new) directory.  Care to\nexplain?\n\n> My work flow is to use a script for --to and --cc\n> lines that can be set to emit the same addresses for\n> all files in a patch series or generate different\n> addresses per patch file.\n"},{"id":"203031","messageId":"CAMP44s1gF7scb2RtZ9V9cz58y8KQuQfRk_4wsCML1JyheScP=g@mail.gmail.com","threadId":"32078","inReplyTo":"7vd2zigwx6.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] send-email: add series-cc-cmd option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2012-11-13T01:01:59Z","receivedAt":"2012-11-13T01:01:59Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Nov 13, 2012 at 1:37 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Joe Perches <joe@perches.com> writes:\n>\n>> On Tue, 2012-11-13 at 03:21 +0530, Ramkumar Ramachandra wrote:\n>>> Felipe Contreras wrote:\n>>> > cc-cmd is only per-file, and many times receipients get lost without\n>>> > seing the full patch series.\n>>>\n>>> s/seing/seeing\n>>>\n>>> > [...]\n>>>\n>>> Looks good otherwise.\n>>\n>> s/receipients/recipients/ too\n>>\n>> Practically this is ok but I think it's unnecessary.\n>>\n>> Output from git format-patch is always in a single\n>> directory.\n>\n> Sorry, but I do not see how the usefulness (or necessity) of this\n> new option is connected to the fact that you can tell the command to\n> write the patches into a single (possibly new) directory.  Care to\n> explain?\n\nBasically 'git send-email' would do something like this:\ngit format-patch -10 -o /tmp\nfor x in /tmp/*; do cc_cmd $x; done\n\nAnd the cc-cmd would do something like:\ncc_cmd() { do_stuff_with $(dirname $1)/*.patch }\n\n-- \nFelipe Contreras\n"}]}