Re: How to use --cc-cmd in git-send-email?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Eric Sunshine" <sunshine@xxxxxxxxxxxxxx>
On Sun, Jul 19, 2015 at 6:02 PM, Philip Oakley <philipoakley@xxxxxxx> 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@xxxxxxxxxxx
   person2@xxxxxxxxxxx
   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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]