git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* How to use --cc-cmd in git-send-email?
@ 2015-07-19 22:02 Philip Oakley
  2015-07-20  1:09 ` Eric Sunshine
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Oakley @ 2015-07-19 22:02 UTC (permalink / raw)
  To: Git List

I've been using git-send-email with repeated individual --cc="email 
address" parameters on the command line.

I tried putting all the addresses, one per line, into a file 'cc-cmd', 
so I could use if for the --cc-cmd option.

I then tried to use --cc-cmd='cat cc-cmd' to do the send-email (as 
a --dry-run). This produced, as part of the output, a list of the output 
of the cc-cmd, which showed not only the file contents, but this was 
then followed by the full patch, as if it was part of the list of email 
addresses.

Finally, at the end of the inclusion of the patch, I got

(cc-cmd) Adding cc: -- from: 'cat cc-cmd'
(cc-cmd) Adding cc: 2.4.2.windows.1.5.gd32afb6 from: 'cat cc-cmd'
(cc-cmd) Adding cc:  from: 'cat cc-cmd'
error: unable to extract a valid address from:
What to do with this address? ([q]uit|[d]rop|[e]dit):

Could this have been caused by an extra (blank) line at the end of the 
cc-cmd file?

Also, does anyone have an example of a working --cc-cmd option?

(this is on g4w: git version 2.3.1)

Philip 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to use --cc-cmd in git-send-email?
  2015-07-19 22:02 How to use --cc-cmd in git-send-email? Philip Oakley
@ 2015-07-20  1:09 ` Eric Sunshine
  2015-07-20  6:01   ` Philip Oakley
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Sunshine @ 2015-07-20  1:09 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Git List

On Sun, Jul 19, 2015 at 6:02 PM, Philip Oakley <philipoakley@iee.org> wrote:
> I've been using git-send-email with repeated individual --cc="email address"
> parameters on the command line.
>
> I tried putting all the addresses, one per line, into a file 'cc-cmd', so I
> could use if for the --cc-cmd option.
>
> I then tried to use --cc-cmd='cat cc-cmd' to do the send-email (as a
> --dry-run). This produced, as part of the output, a list of the output of
> the cc-cmd, which showed not only the file contents, but this was then
> followed by the full patch, as if it was part of the list of email
> addresses.

git-send-email invokes the cc-cmd like this:

    $cc-cmd $patchfilename

so, when you used 'cat cc-cmd' as the value of --cc-cmd, your invocation became:

    cat cc-cmd $patchfilename

and since 'cat' copies the concatenation of its input files to its
output, that explains why you first saw the names from your 'cc-cmd'
file followed by the content of the patch file.

A quick-and-dirty work-around is to use '#' to effectively comment out
the patch file name:

    --cc-cmd='cat cc-cmd #'

which works, but is very, very ugly.

> Could this have been caused by an extra (blank) line at the end of the
> cc-cmd file?

Nope.

> Also, does anyone have an example of a working --cc-cmd option?

A very simple working solution is to make your 'cc-cmd' file executable:

    #!/bin/sh
    echo <<\EOF
    person1@example.com
    person2@example.com
    EOF

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to use --cc-cmd in git-send-email?
  2015-07-20  1:09 ` Eric Sunshine
@ 2015-07-20  6:01   ` Philip Oakley
  2015-07-20  6:06     ` Eric Sunshine
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Oakley @ 2015-07-20  6:01 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Git List

From: "Eric Sunshine" <sunshine@sunshineco.com>
> On Sun, Jul 19, 2015 at 6:02 PM, Philip Oakley <philipoakley@iee.org> 
> wrote:
>> I've been using git-send-email with repeated individual --cc="email 
>> address"
>> parameters on the command line.
>>
>> I tried putting all the addresses, one per line, into a file 
>> 'cc-cmd', so I
>> could use if for the --cc-cmd option.
>>
>> I then tried to use --cc-cmd='cat cc-cmd' to do the send-email (as a
>> --dry-run). This produced, as part of the output, a list of the 
>> output of
>> the cc-cmd, which showed not only the file contents, but this was 
>> then
>> followed by the full patch, as if it was part of the list of email
>> addresses.
>
> git-send-email invokes the cc-cmd like this:
>
>    $cc-cmd $patchfilename
>
> so, when you used 'cat cc-cmd' as the value of --cc-cmd, your 
> invocation became:
>
>    cat cc-cmd $patchfilename
>
> and since 'cat' copies the concatenation of its input files to its
> output, that explains why you first saw the names from your 'cc-cmd'
> file followed by the content of the patch file.

Many thanks, that seems to explain everything!

I'd tried to understand the code but I missed the nuances with my 
limited experience of perl coding.
>
> A quick-and-dirty work-around is to use '#' to effectively comment out
> the patch file name:
>
>    --cc-cmd='cat cc-cmd #'
>
> which works, but is very, very ugly.

But nicely quick and dirty ;-)

>
>> Could this have been caused by an extra (blank) line at the end of 
>> the
>> cc-cmd file?
>
> Nope.
>
>> Also, does anyone have an example of a working --cc-cmd option?
>
> A very simple working solution is to make your 'cc-cmd' file 
> executable:
>
>    #!/bin/sh
>    echo <<\EOF
>    person1@example.com
>    person2@example.com
>    EOF

I may try and do a small doc patch for the git-send-email.txt man page 
(I have a few doc fixes backing up waiting to be done ;-)

--
Philip 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to use --cc-cmd in git-send-email?
  2015-07-20  6:01   ` Philip Oakley
@ 2015-07-20  6:06     ` Eric Sunshine
  2015-07-20 14:20       ` Philip Oakley
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Sunshine @ 2015-07-20  6:06 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Git List

On Mon, Jul 20, 2015 at 2:01 AM, Philip Oakley <philipoakley@iee.org> wrote:
> From: "Eric Sunshine" <sunshine@sunshineco.com>
>> git-send-email invokes the cc-cmd like this:
>>
>>    $cc-cmd $patchfilename
>>
>> so, when you used 'cat cc-cmd' as the value of --cc-cmd, your invocation
>> became:
>>
>>    cat cc-cmd $patchfilename
>>
>> and since 'cat' copies the concatenation of its input files to its
>> output, that explains why you first saw the names from your 'cc-cmd'
>> file followed by the content of the patch file.
>
> Many thanks, that seems to explain everything!
>
> I may try and do a small doc patch for the git-send-email.txt man page (I
> have a few doc fixes backing up waiting to be done ;-)

That would be welcome. I don't think it's mentioned at all in
git-send-email.txt that the --to-cmd/--cc-cmd commands are handed the
patch pathname as an argument, so that's certainly something worth
documenting.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to use --cc-cmd in git-send-email?
  2015-07-20  6:06     ` Eric Sunshine
@ 2015-07-20 14:20       ` Philip Oakley
  2015-07-20 18:07         ` Eric Sunshine
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Oakley @ 2015-07-20 14:20 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Git List

From: "Eric Sunshine" <sunshine@sunshineco.com>
> On Mon, Jul 20, 2015 at 2:01 AM, Philip Oakley <philipoakley@iee.org> 
> wrote:
>> From: "Eric Sunshine" <sunshine@sunshineco.com>
>>> git-send-email invokes the cc-cmd like this:
>>>
>>>    $cc-cmd $patchfilename
>>>
>>> so, when you used 'cat cc-cmd' as the value of --cc-cmd, your 
>>> invocation
>>> became:
>>>
>>>    cat cc-cmd $patchfilename
>>>
>>> and since 'cat' copies the concatenation of its input files to its
>>> output, that explains why you first saw the names from your 'cc-cmd'
>>> file followed by the content of the patch file.
>>
>> Many thanks, that seems to explain everything!
>>
>> I may try and do a small doc patch for the git-send-email.txt man 
>> page (I
>> have a few doc fixes backing up waiting to be done ;-)
>
> That would be welcome. I don't think it's mentioned at all in
> git-send-email.txt that the --to-cmd/--cc-cmd commands are handed the
> patch pathname as an argument, so that's certainly something worth
> documenting.
> --

The other issue I noted was wondering what "auto-cc" is?

It's only mentioned the once in:
    --suppress-cc=<category>

Specify an additional category of recipients to suppress the auto-cc of:

Is it a sort of double negative? Certainly I had no idea what an auto-cc 
was ;-)



Philip

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to use --cc-cmd in git-send-email?
  2015-07-20 14:20       ` Philip Oakley
@ 2015-07-20 18:07         ` Eric Sunshine
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Sunshine @ 2015-07-20 18:07 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Git List

On Mon, Jul 20, 2015 at 10:20 AM, Philip Oakley <philipoakley@iee.org> wrote:
> From: "Eric Sunshine" <sunshine@sunshineco.com>
>> On Mon, Jul 20, 2015 at 2:01 AM, Philip Oakley <philipoakley@iee.org>
>> wrote:
>>> I may try and do a small doc patch for the git-send-email.txt man page (I
>>> have a few doc fixes backing up waiting to be done ;-)
>>
>> That would be welcome. I don't think it's mentioned at all in
>> git-send-email.txt that the --to-cmd/--cc-cmd commands are handed the
>> patch pathname as an argument, so that's certainly something worth
>> documenting.
>
> The other issue I noted was wondering what "auto-cc" is?
>
> It's only mentioned the once in:
>    --suppress-cc=<category>
>
> Specify an additional category of recipients to suppress the auto-cc of:
>
> Is it a sort of double negative? Certainly I had no idea what an auto-cc was
> ;-)

I presume that "auto-cc" refers to git-send-email's behavior of
figuring out whom to cc: automatically (by gleaning email addresses
from various sources, such as the patch itself, cc-cmd, etc.). Even
just saying "...suppress the automatic cc:'ing..." would be an
improvement, though it may deserve its own little paragraph explaining
that automatic cc:'ing is occurring and from where the email addresses
are gleaned.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-07-20 18:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-19 22:02 How to use --cc-cmd in git-send-email? Philip Oakley
2015-07-20  1:09 ` Eric Sunshine
2015-07-20  6:01   ` Philip Oakley
2015-07-20  6:06     ` Eric Sunshine
2015-07-20 14:20       ` Philip Oakley
2015-07-20 18:07         ` Eric Sunshine

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).