git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFD] make rebase abort to original branch, not rebased branch
@ 2011-03-13  3:58 Martin von Zweigbergk
  2011-03-13  7:05 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Martin von Zweigbergk @ 2011-03-13  3:58 UTC (permalink / raw)
  To: git

When git rebase is aborted, it will return the HEAD to the rebased
branch (which has not moved). If the current branch is "topic" and a
run of "git rebase master" is aborted, "topic" is therefore checked
out, which is both what I expect and what I want. When the
two-argument version of git rebase is used, as in "git rebase master
topic", and then aborted, "topic" will be checked out. This is not
what I would expect, although I'm aware of it by now, and usually not
what I want. I would expect to be returned to the branch/commit that
was checked out when I started "git rebase master topic".

In most cases, this is just a small annoyance, since it's usually
quick and easy to manually switch back to the original
branch. However, I have run into at least two cases where it has been
a bit more annoying:

 1. When on a detached HEAD and running "git rebase HEAD topic", if
    you abort the rebase, you will have to look up the old commit in
    the reflog.

 2. I once was rebasing many old branches, mostly to see which ones
    could be rebased without conflicts. The project I was working on
    was pretty big and a lot had changed since those old branches were
    created. If a "new" branch is currently checked out and "git
    rebase master old-branch" is run and causes conflicts, the old
    branch would be checked out. In my case, this would take 5-10
    seconds. Since Junio improved rebase in 0cb0664 (rebase [--onto O]
    A B: omit needless checkout, 2008-03-15), there will be no
    checkouts of any "old" commit in the successful case, so it's a
    shame that it has to happen in the unsuccessful case when the
    rebase is aborted.

Are there valid cases where the current behavior is bettter?

I suppose we can not just change the current behavior due to backward
compatibility constraints. We could introduce a configuration
variable, of we could perhaps change it in 1.8.0. Maybe the problem is
not big enough to do either...


/Martin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-13 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-13  3:58 [RFD] make rebase abort to original branch, not rebased branch Martin von Zweigbergk
2011-03-13  7:05 ` Junio C Hamano
2011-03-13  7:46   ` Junio C Hamano
2011-03-13 14:58   ` Martin von Zweigbergk
2011-03-13 15:27     ` Alexander Miseler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).