git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git rebase --abort of an --onto run does not checkout the originating branch
@ 2010-10-22 17:01 Joshua Jensen
  2010-10-22 19:15 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Joshua Jensen @ 2010-10-22 17:01 UTC (permalink / raw)
  To: git@vger.kernel.org

'git rebase --abort' has documentation stating it will restore the 
original <branch>.  This works great for my basic usage of 'git rebase 
--interactive', for instance.

When running 'git rebase --onto', it does exactly what the documentation 
states, but the restored branch is not desirable.

To cherry pick a range of commits, I run:

git rebase --onto mybranch START_SHA END_SHA

In the middle, I decide to run 'git rebase --abort'.

Just as the documentation states, it performs a checkout of END_SHA as 
the restored branch.  END_SHA has nothing to do with the originating 
branch, and confusion ensues.

Is there a reason why 'git rebase' should not store off the originating 
branch and use that for an --abort, instead of <branch> which is END_SHA?

Thanks.

Josh

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

* Re: git rebase --abort of an --onto run does not checkout the originating branch
  2010-10-22 17:01 git rebase --abort of an --onto run does not checkout the originating branch Joshua Jensen
@ 2010-10-22 19:15 ` Junio C Hamano
  2010-10-28  3:04   ` Joshua Jensen
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2010-10-22 19:15 UTC (permalink / raw)
  To: Joshua Jensen; +Cc: git@vger.kernel.org

Joshua Jensen <jjensen@workspacewhiz.com> writes:

> git rebase --onto mybranch START_SHA END_SHA
>
> In the middle, I decide to run 'git rebase --abort'.
>
> Just as the documentation states, it performs a checkout of END_SHA as
> the restored branch.  END_SHA has nothing to do with the originating
> branch, and confusion ensues.
>
> Is there a reason why 'git rebase' should not store off the
> originating branch and use that for an --abort, instead of <branch>
> which is END_SHA?

When END_SHA is an actual branch name (which by the way is almost always
how I use --onto in my attempts to transplant my topics), and when I found
out that the conflicts I see while rebasing the topic to a different
starting point (i.e. --onto) is too much to handle for too little gain, I
would not appreciate if --abort took me to the --onto branch, which is
totally uninteresting for the purpose of what I was attempting to do,
namely, to deal with the topic.

If the command took me back to the tip of the topic that I failed to
rebase, I can continue attempting to whip it in shape using different
strategies from there (e.g. merging an older part of upstream into the
topic before merging the topic back to the upstream).

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

* Re: git rebase --abort of an --onto run does not checkout the originating branch
  2010-10-22 19:15 ` Junio C Hamano
@ 2010-10-28  3:04   ` Joshua Jensen
  2010-10-28 16:22     ` Jakub Narebski
  0 siblings, 1 reply; 4+ messages in thread
From: Joshua Jensen @ 2010-10-28  3:04 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git@vger.kernel.org

----- Original Message -----
From: Junio C Hamano
Date: 10/22/2010 1:15 PM
> Joshua Jensen<jjensen@workspacewhiz.com>  writes:
>
>> git rebase --onto mybranch START_SHA END_SHA
>>
>> In the middle, I decide to run 'git rebase --abort'.
>>
>> Just as the documentation states, it performs a checkout of END_SHA as
>> the restored branch.  END_SHA has nothing to do with the originating
>> branch, and confusion ensues.
>>
>> Is there a reason why 'git rebase' should not store off the
>> originating branch and use that for an --abort, instead of<branch>
>> which is END_SHA?
> When END_SHA is an actual branch name (which by the way is almost always
> how I use --onto in my attempts to transplant my topics), and when I found
> out that the conflicts I see while rebasing the topic to a different
> starting point (i.e. --onto) is too much to handle for too little gain, I
> would not appreciate if --abort took me to the --onto branch, which is
> totally uninteresting for the purpose of what I was attempting to do,
> namely, to deal with the topic.
>
> If the command took me back to the tip of the topic that I failed to
> rebase, I can continue attempting to whip it in shape using different
> strategies from there (e.g. merging an older part of upstream into the
> topic before merging the topic back to the upstream).
As if turns out, I wasn't expecting --abort to take me to the --onto 
branch but rather, the originating branch.  Let's assume I am working in 
a branch called JBranch.  I run:

         git rebase --onto master START_SHA END_SHA

I decide to abort the rebase.  I expect to be returned to the place I 
started from: JBranch.  After all, I am aborting the rebase.  I don't 
want to proceed.  I decided it was the wrong thing to do, so just put me 
back where I was.

Anyway, that was my thought pattern.  Since that isn't how it works, 
I'll just have to remember where I was when I started the rebase, 
perform the abort, and checkout the originating branch.

Thank you for your time.

Josh

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

* Re: git rebase --abort of an --onto run does not checkout the originating branch
  2010-10-28  3:04   ` Joshua Jensen
@ 2010-10-28 16:22     ` Jakub Narebski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Narebski @ 2010-10-28 16:22 UTC (permalink / raw)
  To: Joshua Jensen; +Cc: Junio C Hamano, git@vger.kernel.org

Joshua Jensen <jjensen@workspacewhiz.com> writes:

> I'll just have to remember where I was when I started the rebase,
> perform the abort, and checkout the originating branch.

"git checkout -" (or its generalization "git checkout @{-<n>}").

P.S. This is discounting whether there is bug in "git rebase --abort"
after using it with `--onto` or not.
-- 
Jakub Narebski
Poland
ShadeHawk on #git

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

end of thread, other threads:[~2010-10-28 16:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 17:01 git rebase --abort of an --onto run does not checkout the originating branch Joshua Jensen
2010-10-22 19:15 ` Junio C Hamano
2010-10-28  3:04   ` Joshua Jensen
2010-10-28 16:22     ` Jakub Narebski

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).