git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Gustaf Hendeby <hendeby@isy.liu.se>
Date
Dec 21, 2007, 21:07 UTC
Message-ID
<476C2B2E.1080801@isy.liu.se>
In-Reply-To
<20071221192359.GA10660@coredump.intra.peff.net>
On 2007-12-21 20:23, Jeff King wrote:
Show 11 quoted lines
> On Fri, Dec 21, 2007 at 04:23:11PM +0100, Gustaf Hendeby wrote:
> 
>>> If you are going to do it that way, I suspect you want to quotemeta
>>> $compose_filename.
>> Generally that would be true, but is that really necessary when I know
>> $compose_filename is defined as:
>>
>> my $compose_filename = ".msg.$$";
> 
> I know; it is just easier to see that it is correct with the quotemeta
> (and correct in the face of somebody changing the message later).
Point taken!
Show 14 quoted lines
> 
>> Or, should I take it that you prefer the version using split?  I didn't
>> really feel good about the possibility of splitting paths with spaces
>> that came with that one though.
> 
> 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).

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. On the top of my head I can't come up with any other commands using $EDITOR. I'll try to find some time the next couple of days to make a reasonable equivalent solution here.

Thanks,
	Gustaf

begin:vcard fn:Gustaf Hendeby n:Hendeby;Gustaf org;quoted-printable:Link=C3=B6ping University;Department of Electrical Engineering adr;quoted-printable:;;;Link=C3=B6ping;;SE-581 83;Sweden email;internet:hendeby@isy.liu.se title:PhD Student tel;work:+46 (0)13 282226 tel;fax:+46 (0)13 282622 x-mozilla-html:FALSE url:http://www.control.isy.liu.se/~hendeby version:2.1 end:vcard

Previous: Jeff KingNext: Junio C Hamano
Message 7 of 19 in “Make git send-email accept $EDITOR with arguments”
  1. Make git send-email accept $EDITOR with argumentsGustaf Hendeby, Dec 20, 2007
  2. Luciano RochaDec 20, 2007
  3. Make git send-email accept $EDITOR with argumentsGustaf Hendeby, Dec 21, 2007
  4. Jeff KingDec 21, 2007
  5. Gustaf HendebyDec 21, 2007
  6. Jeff KingDec 21, 2007
  7. Gustaf HendebyDec 21, 2007
  8. Junio C HamanoDec 21, 2007
  9. Make git send-email accept $EDITOR with argumentsGustaf Hendeby, Dec 22, 2007
  10. Junio C HamanoDec 22, 2007
  11. Gustaf HendebyDec 22, 2007
  12. Junio C HamanoDec 21, 2007
  13. Move git send-email cover letter temporary file to $GIT_DIRGustaf Hendeby, Dec 22, 2007
  14. Junio C HamanoDec 22, 2007
  15. David SymondsDec 22, 2007
  16. Junio C HamanoDec 22, 2007
  17. David SymondsDec 22, 2007
  18. Junio C HamanoDec 22, 2007
  19. Gustaf HendebyDec 22, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.