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

Re: [PATCH] git-svn: Allow using arguments to the editor.

From
Thomas Rast <trast@student.ethz.ch>
Date
Feb 18, 2009, 15:43 UTC
Message-ID
<200902181643.59516.trast@student.ethz.ch>
In-Reply-To
<20090218144814.GA23938@anguilla.debian.or.at>
Gerfried Fuchs wrote:
Show 6 quoted lines
>  I'm not sure where quoted spaces and such are handled very much
> differently. How would you quote it that wouldn't make tons of programs
> fail? EDITOR='"/my space path/prog"' doesn't work in most applications
> because they wouldn't strip the embedded quotes, neither does
> EDITOR='/my\ space\ path/prog' work. EDITOR='/my space path/prog' might
> work in some (current git-svn) but not in all.

I have EDITOR='emacs -nw' and it works for git, svn and hg. (Which are roughly the ones I care about.)

Show 8 quoted lines
>  I haven't looked into how git does it directly, but it offers that
> posibility:
> EDITOR="vim -c 'syn off'" git commit -a
> 
>  I wasn't able to figure out any way to use a space-embedded filename in
> EDITOR for git - so why should git-svn behave differently here? But you
> are right, this very example shows clearly that my approach is
> incomplete because it can't handle the 'syn off' part.
launch_editor (in editor.c) does roughly the following in Perl:
  # set $editor according to config/variables
  my @editor = ($editor);
  if ($editor =~ /["$\t ]/) {
      @editor = ('sh', '-c', $editor . ' "$@"', $editor);
  }
  system(@editor, @rest_of_args);

I'm not a Perl expert but that's my current educated guess of what it translates to ;-)

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Gerfried FuchsNext: Eric Wong
Message 4 of 5 in “git-svn: Allow using arguments to the editor.”
  1. git-svn: Allow using arguments to the editor.Gerfried Fuchs, Feb 18, 2009
  2. Thomas RastFeb 18, 2009
  3. Gerfried FuchsFeb 18, 2009
  4. Thomas RastFeb 18, 2009
  5. Eric WongFeb 19, 2009

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.