Interactive Rebase

286 views
Skip to first unread message

Alan Clucas

unread,
Nov 12, 2013, 4:06:43 AM11/12/13
to git-...@googlegroups.com
I've just updated to 1.9.1 on Windows 8, with python 2.7.5.

The interactive rebase button offers "Select new upstream", but then when I choose something or type in HEAD^4 for example nothing happens when I press the "Interactive Rebase" button. It does pause for a small amount of time, and that amount of time is significantly greater if I try to rebase onto a position far away from where I am now. Everything in my tree is committed.

If I setup GIT_SEQUENCE_EDITOR to git-xbase everything works as expected from the command line.

Running git-cola from the git bash shell gives no indication of what's wrong. I've just also checked out e59331ba32c909cf55ab34685bbbbcc0d909b858 and run that under xubuntu 3.10 with python 2.7.5 and I get the same behaviour.

So should something happen, or is it not hooked up yet? If someone can give me some guidance I may be able to debug.

David Aguilar

unread,
Nov 15, 2013, 2:07:23 PM11/15/13
to Alan Clucas, git-...@googlegroups.com
Hmm. What version of git are you using?

It's curious that you are able to use it by setting GIT_SEQUENCE_EDITOR
but not via the GUI.

Here's a a guess. Does your version of git support:
git rebase --interactive --autosquash

My guess is that it may be the --autosquash option. It's fairly new.
I've typically test on Debian Linux and OS X so I wouldn't
expect any problems there. At first I assumed it was a Windows issue
(which it may be) but maybe you can try getting the Linux one working
first to rule out any other issues?
--
David

Alan Clucas

unread,
Nov 20, 2013, 7:00:22 AM11/20/13
to git-...@googlegroups.com, Alan Clucas

So on windows it's: git version 1.8.4.msysgit.0
and on linux it's: git version 1.8.3.2

Both appear to support --autosquash.

I assume when I attempt the interactive rebase through the GUI, it will attempt to invoke git-xbase. As that's in share/git-cola/bin, perhaps it can't find it (I'm unsure how it should find it). I have tried a few things, including an outright copy of git-xbase onto a directory on my path, but nothing seems to work. (On linux).

I have looked at the code, but can't work out how git-xbase/GIT_SEQUENCE_EDITOR are supposed to get invoked by git-cola.


David Aguilar

unread,
Jan 10, 2014, 12:08:04 AM1/10/14
to Alan Clucas, git-cola
Okay.

First off, please try debugging this on Linux or BSD/OS X. All bets
are off on Windows...

> I assume when I attempt the interactive rebase through the GUI, it will
> attempt to invoke git-xbase. As that's in share/git-cola/bin, perhaps it
> can't find it (I'm unsure how it should find it). I have tried a few things,
> including an outright copy of git-xbase onto a directory on my path, but
> nothing seems to work. (On linux).
>
> I have looked at the code, but can't work out how
> git-xbase/GIT_SEQUENCE_EDITOR are supposed to get invoked by git-cola.

The code is in cola/cmds.py. The relevant classes are 'Rebase' and
'GitXBaseContext'.

The context is the one that sets the GIT_SEQUENCE_EDITOR environment
variable. Make sure you're running the latest code.

The reason you don't see an explicit invocation of "git-xbase" is
simply because we don't invoke it directly. It's invoked indirectly
via the "git.rebase(...)" call. The actual code that calls the script
is in Git's source code (git-rebase--interactive.sh).

Here's the patch that added this feature to Git itself:

http://thread.gmane.org/gmane.comp.version-control.git/183819/focus=183826

The reason I say try Linux or BSD/Mac OS X is that we set
GIT_SEQUENCE_EDITOR to a python file with a #! shebang line. I have no
idea how that would work on Windows, and whether it's even possible
as-is. It might be broken, who knows.

In any case, you said you made it work by setting GIT_SEQUENCE_EDITOR
and then running "git rebase" manually. That's basically all we do as
well (check the code). You can also set GIT_TRACE=1 if you'd like to
see what commands git-cola is running. You'll see that it's basically
just e.g. "git rebase --interactive --autosquash origin/master" where
"origin/master" is the "new upstream" that you select in the GUI.

I don't use Windows, sorry. My "Windows box" is a janky Win2k VM and
I only use it for creating the win32 installer.

I'm sure it's possible to make it work on Windows but that's not my
itch to scratch (who knows, it might already work). Patches are very
much appreciated, though. My Windows-fu is pretty much non-existent
so if anyone knows Windows + Python then the help would be much
appreciated.

I hope that helps,
--
David
Reply all
Reply to author
Forward
0 new messages