Re: [PATCH v2] Make git send-email accept $EDITOR with arguments

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

 



Gustaf Hendeby <hendeby@xxxxxxxxxx> writes:

> On 2007-12-21 20:23, Jeff King wrote:
> 
>> I am fine with using the shell. Though keep in mind that the two
>> solutions will behave differently with
>> 
>>   EDITOR='foo; bar'
>> 
>> That is, system("$editor $message") will actually invoke the shell,
>> whereas system(split(/ /, $editor), $message) will _just_ split on
>> whitespace. We should do whatever is consistent with the rest of the git
>> commands (off the top of my head, I don't know).

Personally, I think EDITOR='foo; bar' is a user shooting his
foot off which we do not care about.

> A quick look at the proposed solution to the similar problem with git
> commit, using code now in git tag, it seems it uses a split like
> solution, though taking " and ' quoting into consideration.

I think the easiest to read and compatible way is:

	system('sh', '-c', '$0 $@', $editor, $filename)
-
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]

  Powered by Linux