Thread (7 messages) flat view 7 messages, 6 authors, 2016-06-15

Re: call external editor from git-gui?

From: David Kastrup <hidden>
Date: 2016-06-15 22:43:29

Jan Hudec [off-list ref] writes:
On Tue, Aug 14, 2007 at 09:00:00 +0200, Karl Hasselström wrote:
quoted
On 2007-08-14 00:55:11 -0400, Shawn O. Pearce wrote:
quoted
Spawning the user's preferred editor would be a nice way to get some
of that.
Mmm. I wouldn't call it a _nice_ way: popping up an external program
just to get the right text editing behavior. More like the _only_ way,
if the user is picky enough.
It might actually have a rather serious twist. Often the editor for
git-commit would use the terminal git-commit runs on. But for git-gui you may
not have any terminal (running git-gui from context menu of some file
manager) and even if you do, the user does not expect it to be used. So the
user may -- and quite often will -- want different editors for running from
git-gui and git-commit.
The usual convention (though _very_ hard to find anywhere explicitly,
so it might more often than not be ignored) is that $VISUAL points to
an editor that requires a tty to work on, while $EDITOR might get
along without one.

So one uses VISUAL in preference of EDITOR on ttys/proper terminals,
but only EDITOR when without one.  A call from git-gui would probably
fall in the second category.  A call from tig, in contrast, in the
first category.

The GIT_EDITOR variable has no way of expressing this difference,
though.  And I doubt that many people remember this.  I googled around
but failed to come up with a useful reference (of course, both
variable names being common words does not exactly help).

-- 
David Kastrup
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help