Re: [RFC/WIP PATCH] Use config value rebase.editor as editor when starting git rebase -i

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 11, 2011 at 1:56 PM, Peter Oberndorfer <kumbayo84@xxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]