From: Phil Hord Date: Tue, 11 Oct 2011 18:15:25 GMT Subject: Re: [RFC/WIP PATCH] Use config value rebase.editor as editor when starting git rebase -i Message-ID: In-Reply-To: <201110111956.08829.kumbayo84@arcor.de> On Tue, Oct 11, 2011 at 1:56 PM, Peter Oberndorfer wrote: > i wrote a (not yet released) git rebase -i helper that allows to order commits > by drag/drop and allows to select the action from a combo box. > (written in Qt) > See http://i55.tinypic.com/2d94gg0.jpg for how it currently looks like. :-) > No more typos, no more lost commit by cutting without pasting... [+1] > > To integrate this properly into git i need something like this patch. > > Open questions/problems: > * GIT_EDITOR env var is not honored anymore after this change. >  Help from somebody with more bash knowledge is highly appreciated! > > * Should git_rebase_editor be in git-rebase--interactive.sh instead >  (since it is only used there) > > * How should the config be called? >  It is not directly used during rebase, only during rebase -i >  that might not be fully clear from the config name. > > * Better config.txt description? > > Thanks, > Greetings Peter > > PS: My tool will hopefully be released soon. > Cleanup code, test(lin/ win), write some doc (how to use with git), > choose name :-), choose license... > >  Documentation/config.txt   |    6 ++++++ >  git-rebase--interactive.sh |    2 +- >  git-sh-setup.sh            |   13 +++++++++++++ >  3 files changed, 20 insertions(+), 1 deletions(-) > > diff --git a/Documentation/config.txt b/Documentation/config.txt > index 03296b7..1d9ae79 100644 > --- a/Documentation/config.txt > +++ b/Documentation/config.txt > @@ -1591,6 +1591,12 @@ rebase.stat:: >        Whether to show a diffstat of what changed upstream since the last >        rebase. False by default. > > +rebase.editor:: > +       Text editor used by git rebase -i for editing the rebasse todo file. s/rebasse/rebase/ >  cp "$todo" "$todo".backup > -git_editor "$todo" || > +git_rebase_editor "$todo" || >        die_abort "Could not execute editor" Maybe something like this would work: git_rebase_editor "$todo" || git_editor "$todo" ||        die_abort "Could not execute editor" If git_rebase_editor call returns an error (non-zero exit code), then git_editor will be invoked. If that also returns an error, then the die_abort is called. I think this will allow your env:GIT_EDITOR to work as expected. Phil