{"thread":{"id":"39896","subject":"How to use --cc-cmd in git-send-email?","startedAt":"2015-07-19T22:02:39Z","lastAt":"2015-07-20T18:07:00Z","messageCount":6,"participants":["Philip Oakley","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"266462","messageId":"CA64425B296E41328D6A1F29E227A24D@PhilipOakley","threadId":"39896","inReplyTo":null,"subject":"How to use --cc-cmd in git-send-email?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2015-07-19T22:02:39Z","receivedAt":"2015-07-19T22:02:39Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"I've been using git-send-email with repeated individual --cc=\"email \naddress\" parameters on the command line.\n\nI tried putting all the addresses, one per line, into a file 'cc-cmd', \nso I could use if for the --cc-cmd option.\n\nI then tried to use --cc-cmd='cat cc-cmd' to do the send-email (as \na --dry-run). This produced, as part of the output, a list of the output \nof the cc-cmd, which showed not only the file contents, but this was \nthen followed by the full patch, as if it was part of the list of email \naddresses.\n\nFinally, at the end of the inclusion of the patch, I got\n\n(cc-cmd) Adding cc: -- from: 'cat cc-cmd'\n(cc-cmd) Adding cc: 2.4.2.windows.1.5.gd32afb6 from: 'cat cc-cmd'\n(cc-cmd) Adding cc:  from: 'cat cc-cmd'\nerror: unable to extract a valid address from:\nWhat to do with this address? ([q]uit|[d]rop|[e]dit):\n\nCould this have been caused by an extra (blank) line at the end of the \ncc-cmd file?\n\nAlso, does anyone have an example of a working --cc-cmd option?\n\n(this is on g4w: git version 2.3.1)\n\nPhilip \n"},{"id":"266467","messageId":"CAPig+cTQspD+0StY5tneqwekS3xCjdxcidoDA7Ztf26g-tMucg@mail.gmail.com","threadId":"39896","inReplyTo":"CA64425B296E41328D6A1F29E227A24D@PhilipOakley","subject":"Re: How to use --cc-cmd in git-send-email?","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-07-20T01:09:20Z","receivedAt":"2015-07-20T01:09:20Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Jul 19, 2015 at 6:02 PM, Philip Oakley <philipoakley@iee.org> wrote:\n> I've been using git-send-email with repeated individual --cc=\"email address\"\n> parameters on the command line.\n>\n> I tried putting all the addresses, one per line, into a file 'cc-cmd', so I\n> could use if for the --cc-cmd option.\n>\n> I then tried to use --cc-cmd='cat cc-cmd' to do the send-email (as a\n> --dry-run). This produced, as part of the output, a list of the output of\n> the cc-cmd, which showed not only the file contents, but this was then\n> followed by the full patch, as if it was part of the list of email\n> addresses.\n\ngit-send-email invokes the cc-cmd like this:\n\n    $cc-cmd $patchfilename\n\nso, when you used 'cat cc-cmd' as the value of --cc-cmd, your invocation became:\n\n    cat cc-cmd $patchfilename\n\nand since 'cat' copies the concatenation of its input files to its\noutput, that explains why you first saw the names from your 'cc-cmd'\nfile followed by the content of the patch file.\n\nA quick-and-dirty work-around is to use '#' to effectively comment out\nthe patch file name:\n\n    --cc-cmd='cat cc-cmd #'\n\nwhich works, but is very, very ugly.\n\n> Could this have been caused by an extra (blank) line at the end of the\n> cc-cmd file?\n\nNope.\n\n> Also, does anyone have an example of a working --cc-cmd option?\n\nA very simple working solution is to make your 'cc-cmd' file executable:\n\n    #!/bin/sh\n    echo <<\\EOF\n    person1@example.com\n    person2@example.com\n    EOF\n"},{"id":"266477","messageId":"8684534127894F239338493A7D15F46D@PhilipOakley","threadId":"39896","inReplyTo":"CAPig+cTQspD+0StY5tneqwekS3xCjdxcidoDA7Ztf26g-tMucg@mail.gmail.com","subject":"Re: How to use --cc-cmd in git-send-email?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2015-07-20T06:01:44Z","receivedAt":"2015-07-20T06:01:44Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Eric Sunshine\" <sunshine@sunshineco.com>\n> On Sun, Jul 19, 2015 at 6:02 PM, Philip Oakley <philipoakley@iee.org> \n> wrote:\n>> I've been using git-send-email with repeated individual --cc=\"email \n>> address\"\n>> parameters on the command line.\n>>\n>> I tried putting all the addresses, one per line, into a file \n>> 'cc-cmd', so I\n>> could use if for the --cc-cmd option.\n>>\n>> I then tried to use --cc-cmd='cat cc-cmd' to do the send-email (as a\n>> --dry-run). This produced, as part of the output, a list of the \n>> output of\n>> the cc-cmd, which showed not only the file contents, but this was \n>> then\n>> followed by the full patch, as if it was part of the list of email\n>> addresses.\n>\n> git-send-email invokes the cc-cmd like this:\n>\n>    $cc-cmd $patchfilename\n>\n> so, when you used 'cat cc-cmd' as the value of --cc-cmd, your \n> invocation became:\n>\n>    cat cc-cmd $patchfilename\n>\n> and since 'cat' copies the concatenation of its input files to its\n> output, that explains why you first saw the names from your 'cc-cmd'\n> file followed by the content of the patch file.\n\nMany thanks, that seems to explain everything!\n\nI'd tried to understand the code but I missed the nuances with my \nlimited experience of perl coding.\n>\n> A quick-and-dirty work-around is to use '#' to effectively comment out\n> the patch file name:\n>\n>    --cc-cmd='cat cc-cmd #'\n>\n> which works, but is very, very ugly.\n\nBut nicely quick and dirty ;-)\n\n>\n>> Could this have been caused by an extra (blank) line at the end of \n>> the\n>> cc-cmd file?\n>\n> Nope.\n>\n>> Also, does anyone have an example of a working --cc-cmd option?\n>\n> A very simple working solution is to make your 'cc-cmd' file \n> executable:\n>\n>    #!/bin/sh\n>    echo <<\\EOF\n>    person1@example.com\n>    person2@example.com\n>    EOF\n\nI may try and do a small doc patch for the git-send-email.txt man page \n(I have a few doc fixes backing up waiting to be done ;-)\n\n--\nPhilip \n"},{"id":"266478","messageId":"CAPig+cTsJQ+dK5M0S8LERkPWiipzxLYdbCK6-ghen1OkAX=NBg@mail.gmail.com","threadId":"39896","inReplyTo":"8684534127894F239338493A7D15F46D@PhilipOakley","subject":"Re: How to use --cc-cmd in git-send-email?","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-07-20T06:06:17Z","receivedAt":"2015-07-20T06:06:17Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Jul 20, 2015 at 2:01 AM, Philip Oakley <philipoakley@iee.org> wrote:\n> From: \"Eric Sunshine\" <sunshine@sunshineco.com>\n>> git-send-email invokes the cc-cmd like this:\n>>\n>>    $cc-cmd $patchfilename\n>>\n>> so, when you used 'cat cc-cmd' as the value of --cc-cmd, your invocation\n>> became:\n>>\n>>    cat cc-cmd $patchfilename\n>>\n>> and since 'cat' copies the concatenation of its input files to its\n>> output, that explains why you first saw the names from your 'cc-cmd'\n>> file followed by the content of the patch file.\n>\n> Many thanks, that seems to explain everything!\n>\n> I may try and do a small doc patch for the git-send-email.txt man page (I\n> have a few doc fixes backing up waiting to be done ;-)\n\nThat would be welcome. I don't think it's mentioned at all in\ngit-send-email.txt that the --to-cmd/--cc-cmd commands are handed the\npatch pathname as an argument, so that's certainly something worth\ndocumenting.\n"},{"id":"266487","messageId":"28D6CFA8D1964D34B1E7F28325AF94A8@PhilipOakley","threadId":"39896","inReplyTo":"CAPig+cTsJQ+dK5M0S8LERkPWiipzxLYdbCK6-ghen1OkAX=NBg@mail.gmail.com","subject":"Re: How to use --cc-cmd in git-send-email?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2015-07-20T14:20:15Z","receivedAt":"2015-07-20T14:20:15Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Eric Sunshine\" <sunshine@sunshineco.com>\n> On Mon, Jul 20, 2015 at 2:01 AM, Philip Oakley <philipoakley@iee.org> \n> wrote:\n>> From: \"Eric Sunshine\" <sunshine@sunshineco.com>\n>>> git-send-email invokes the cc-cmd like this:\n>>>\n>>>    $cc-cmd $patchfilename\n>>>\n>>> so, when you used 'cat cc-cmd' as the value of --cc-cmd, your \n>>> invocation\n>>> became:\n>>>\n>>>    cat cc-cmd $patchfilename\n>>>\n>>> and since 'cat' copies the concatenation of its input files to its\n>>> output, that explains why you first saw the names from your 'cc-cmd'\n>>> file followed by the content of the patch file.\n>>\n>> Many thanks, that seems to explain everything!\n>>\n>> I may try and do a small doc patch for the git-send-email.txt man \n>> page (I\n>> have a few doc fixes backing up waiting to be done ;-)\n>\n> That would be welcome. I don't think it's mentioned at all in\n> git-send-email.txt that the --to-cmd/--cc-cmd commands are handed the\n> patch pathname as an argument, so that's certainly something worth\n> documenting.\n> --\n\nThe other issue I noted was wondering what \"auto-cc\" is?\n\nIt's only mentioned the once in:\n    --suppress-cc=<category>\n\nSpecify an additional category of recipients to suppress the auto-cc of:\n\nIs it a sort of double negative? Certainly I had no idea what an auto-cc \nwas ;-)\n\n\n\nPhilip\n"},{"id":"266502","messageId":"CAPig+cS3NxpTLJL42oV_JpxEjAJSCwrdSuJCWMQxfwK4QjEx8Q@mail.gmail.com","threadId":"39896","inReplyTo":"28D6CFA8D1964D34B1E7F28325AF94A8@PhilipOakley","subject":"Re: How to use --cc-cmd in git-send-email?","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2015-07-20T18:07:00Z","receivedAt":"2015-07-20T18:07:00Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Jul 20, 2015 at 10:20 AM, Philip Oakley <philipoakley@iee.org> wrote:\n> From: \"Eric Sunshine\" <sunshine@sunshineco.com>\n>> On Mon, Jul 20, 2015 at 2:01 AM, Philip Oakley <philipoakley@iee.org>\n>> wrote:\n>>> I may try and do a small doc patch for the git-send-email.txt man page (I\n>>> have a few doc fixes backing up waiting to be done ;-)\n>>\n>> That would be welcome. I don't think it's mentioned at all in\n>> git-send-email.txt that the --to-cmd/--cc-cmd commands are handed the\n>> patch pathname as an argument, so that's certainly something worth\n>> documenting.\n>\n> The other issue I noted was wondering what \"auto-cc\" is?\n>\n> It's only mentioned the once in:\n>    --suppress-cc=<category>\n>\n> Specify an additional category of recipients to suppress the auto-cc of:\n>\n> Is it a sort of double negative? Certainly I had no idea what an auto-cc was\n> ;-)\n\nI presume that \"auto-cc\" refers to git-send-email's behavior of\nfiguring out whom to cc: automatically (by gleaning email addresses\nfrom various sources, such as the patch itself, cc-cmd, etc.). Even\njust saying \"...suppress the automatic cc:'ing...\" would be an\nimprovement, though it may deserve its own little paragraph explaining\nthat automatic cc:'ing is occurring and from where the email addresses\nare gleaned.\n"}]}