git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git rebase --abort of an --onto run does not checkout the originating branch

From
Joshua Jensen <jjensen@workspacewhiz.com>
Date
Oct 28, 2010, 03:04 UTC
Message-ID
<4CC8E84C.3030709@workspacewhiz.com>
In-Reply-To
<7vlj5qkpjc.fsf@alter.siamese.dyndns.org>
----- Original Message -----
From: Junio C Hamano
Date: 10/22/2010 1:15 PM
Show 25 quoted lines
> 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
Previous: Junio C HamanoNext: Jakub Narebski
Message 3 of 4 in “git rebase --abort of an --onto run does not checkout the originating branch”
  1. Joshua JensenOct 22, 2010
  2. Junio C HamanoOct 22, 2010
  3. Joshua JensenOct 28, 2010
  4. Jakub NarebskiOct 28, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.