git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Gerfried Fuchs <rhonda@deb.at>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-svn: Allow using arguments to the editor.
Date: Wed, 18 Feb 2009 16:43:55 +0100	[thread overview]
Message-ID: <200902181643.59516.trast@student.ethz.ch> (raw)
In-Reply-To: <20090218144814.GA23938@anguilla.debian.or.at>

[-- Attachment #1: Type: text/plain, Size: 1362 bytes --]

Gerfried Fuchs wrote:
>  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.)

>  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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-02-18 15:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-18 13:47 [PATCH] git-svn: Allow using arguments to the editor Gerfried Fuchs
2009-02-18 14:15 ` Thomas Rast
2009-02-18 14:48   ` Gerfried Fuchs
2009-02-18 15:43     ` Thomas Rast [this message]
2009-02-19  8:10 ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200902181643.59516.trast@student.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=rhonda@deb.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).