Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add an interactive rebase GUI with drag + drop editing #1

Closed
davvid opened this Issue · 5 comments

3 participants

@davvid
Owner

A gui for 'git rebase -i' would royally rock.

We'd need to check on the status on git-sequencer. Ideally we'd just be providing an interactive front end to the 'rebase -i' text file, though integrating more tightly might mean implementing parts of rebase in python.

@sylr

I second that.

@davvid davvid was assigned
@davvid
Owner

git 1.7.8 (not yet released) would allow us to do, for example:

$ git config --global sequencer.editor /usr/share/git-cola/bin/git-cola-rebase

...and use a custom GUI as the rebase editor. We could do all the drag/drop editing in there.

Older versions of git could accomplish the same thing by doing:

$ GIT_EDITOR=/usr/share/git-cola/bin/git-cola-rebase git rebase -i commit

So that could be one way to do it.

Newer git versions understand "fixup" and "exec" so we'll need to do some version checks so that we can suppress that option for older versions.

I'm not really sure how to best handle "reword", "edit", and "squash".

Hijacking "GIT_EDITOR" means git would execute git-cola-rebase as the editor when editing commit messages ("squash", "reword"). We obviously do not want that -- we want it to execute the regular editor e.g. gvim, or whatever git would normally use as its editor.

Do we need to make sure that core.editor is not set to something like vim which expects a terminal? We should at least warn.

It wouldn't be a bad idea to have a simple skeletor version for drag and drop re-ordering. That subset of features is safe and won't bring in the GIT_EDITOR dragons.

We could guard the advanced features behind a git-1.7.8 version check and a runtime check to ensure that GIT_EDITOR is not defined to the rebase script. We'll need to read older versions of git-rebase--interactive.sh to see what the lower bound is on the git versions to support.

In any case, I think writing a custom editor over the rebase instruction sheet is probably the way to go. What do you think @ugtar?

@ugtar
Owner

mmmm... I think this issue is git cola's white whale =)

@davvid davvid referenced this issue from a commit in davvid/git-cola
@davvid davvid git-xbase: add an interactive rebase editor
git-xbase is a standalone rebase editor that can be used
from the command-line, e.g.:

	GIT_SEQUENCE_EDITOR=$PWD/share/git-cola/bin/git-xbase git rebase -i master

Subsequent commits will integrate this script into the git-cola UI.

Related-to: #1

Signed-off-by: David Aguilar <davvid@gmail.com>
16887ca
@davvid davvid closed this issue from a commit
@davvid davvid main: add an interactive rebase editor
Integrate the "git-xbase" command into main UI.  This adds a
full interactive rebase editor and a branch-new "Rebase" menu.

The white whale has been spotted!

Closes #1

Encouraged-by: Uri Okrent <uokrent@gmail.com>
Encouraged-by: Sylvain Rabot @sylr via github.com
Signed-off-by: David Aguilar <davvid@gmail.com>
3c9b90f
@davvid davvid closed this in 3c9b90f
@davvid
Owner

Modern Git understands GIT_SEQUENCE_EDITOR, which is what allowed us to finally spot that white :whale: ;-)

It took a while, but it's not too shabby. It might be worth making it so that we show the message + diff when clicking a commit as a future enhancement.

@ugtar
Owner
@davvid davvid referenced this issue from a commit in davvid/git-cola
@davvid davvid git xbase: add an inline diff viewer
Add a diff viewer (the same as the one used in the DAG viewer) to
display commits as they are selected in the list.

Allow launching an external diff via "git difftool".
Move the help message into a menu action.

Related-to: #1

Signed-off-by: David Aguilar <davvid@gmail.com>
d05a205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.