{"thread":{"id":"25525","subject":"git rebase --abort of an --onto run does not checkout the originating branch","startedAt":"2010-10-22T17:01:02Z","lastAt":"2010-10-28T16:22:08Z","messageCount":4,"participants":["Joshua Jensen","Junio C Hamano","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"154167","messageId":"4CC1C34E.8090203@workspacewhiz.com","threadId":"25525","inReplyTo":null,"subject":"git rebase --abort of an --onto run does not checkout the originating branch","fromName":"Joshua Jensen","fromEmail":"jjensen@workspacewhiz.com","sentAt":"2010-10-22T17:01:02Z","receivedAt":"2010-10-22T17:01:02Z","isPatch":false,"sender":{"key":"jjensen@workspacewhiz.com","avatar":"https://avatars.githubusercontent.com/u/111687?v=4"},"body":"'git rebase --abort' has documentation stating it will restore the \noriginal <branch>.  This works great for my basic usage of 'git rebase \n--interactive', for instance.\n\nWhen running 'git rebase --onto', it does exactly what the documentation \nstates, but the restored branch is not desirable.\n\nTo cherry pick a range of commits, I run:\n\ngit rebase --onto mybranch START_SHA END_SHA\n\nIn the middle, I decide to run 'git rebase --abort'.\n\nJust as the documentation states, it performs a checkout of END_SHA as \nthe restored branch.  END_SHA has nothing to do with the originating \nbranch, and confusion ensues.\n\nIs there a reason why 'git rebase' should not store off the originating \nbranch and use that for an --abort, instead of <branch> which is END_SHA?\n\nThanks.\n\nJosh\n"},{"id":"154191","messageId":"7vlj5qkpjc.fsf@alter.siamese.dyndns.org","threadId":"25525","inReplyTo":"4CC1C34E.8090203@workspacewhiz.com","subject":"Re: git rebase --abort of an --onto run does not checkout the originating branch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-10-22T19:15:03Z","receivedAt":"2010-10-22T19:15:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Joshua Jensen <jjensen@workspacewhiz.com> writes:\n\n> git rebase --onto mybranch START_SHA END_SHA\n>\n> In the middle, I decide to run 'git rebase --abort'.\n>\n> Just as the documentation states, it performs a checkout of END_SHA as\n> the restored branch.  END_SHA has nothing to do with the originating\n> branch, and confusion ensues.\n>\n> Is there a reason why 'git rebase' should not store off the\n> originating branch and use that for an --abort, instead of <branch>\n> which is END_SHA?\n\nWhen END_SHA is an actual branch name (which by the way is almost always\nhow I use --onto in my attempts to transplant my topics), and when I found\nout that the conflicts I see while rebasing the topic to a different\nstarting point (i.e. --onto) is too much to handle for too little gain, I\nwould not appreciate if --abort took me to the --onto branch, which is\ntotally uninteresting for the purpose of what I was attempting to do,\nnamely, to deal with the topic.\n\nIf the command took me back to the tip of the topic that I failed to\nrebase, I can continue attempting to whip it in shape using different\nstrategies from there (e.g. merging an older part of upstream into the\ntopic before merging the topic back to the upstream).\n"},{"id":"154607","messageId":"4CC8E84C.3030709@workspacewhiz.com","threadId":"25525","inReplyTo":"7vlj5qkpjc.fsf@alter.siamese.dyndns.org","subject":"Re: git rebase --abort of an --onto run does not checkout the originating branch","fromName":"Joshua Jensen","fromEmail":"jjensen@workspacewhiz.com","sentAt":"2010-10-28T03:04:44Z","receivedAt":"2010-10-28T03:04:44Z","isPatch":false,"sender":{"key":"jjensen@workspacewhiz.com","avatar":"https://avatars.githubusercontent.com/u/111687?v=4"},"body":"----- Original Message -----\nFrom: Junio C Hamano\nDate: 10/22/2010 1:15 PM\n> Joshua Jensen<jjensen@workspacewhiz.com>  writes:\n>\n>> git rebase --onto mybranch START_SHA END_SHA\n>>\n>> In the middle, I decide to run 'git rebase --abort'.\n>>\n>> Just as the documentation states, it performs a checkout of END_SHA as\n>> the restored branch.  END_SHA has nothing to do with the originating\n>> branch, and confusion ensues.\n>>\n>> Is there a reason why 'git rebase' should not store off the\n>> originating branch and use that for an --abort, instead of<branch>\n>> which is END_SHA?\n> When END_SHA is an actual branch name (which by the way is almost always\n> how I use --onto in my attempts to transplant my topics), and when I found\n> out that the conflicts I see while rebasing the topic to a different\n> starting point (i.e. --onto) is too much to handle for too little gain, I\n> would not appreciate if --abort took me to the --onto branch, which is\n> totally uninteresting for the purpose of what I was attempting to do,\n> namely, to deal with the topic.\n>\n> If the command took me back to the tip of the topic that I failed to\n> rebase, I can continue attempting to whip it in shape using different\n> strategies from there (e.g. merging an older part of upstream into the\n> topic before merging the topic back to the upstream).\nAs if turns out, I wasn't expecting --abort to take me to the --onto \nbranch but rather, the originating branch.  Let's assume I am working in \na branch called JBranch.  I run:\n\n         git rebase --onto master START_SHA END_SHA\n\nI decide to abort the rebase.  I expect to be returned to the place I \nstarted from: JBranch.  After all, I am aborting the rebase.  I don't \nwant to proceed.  I decided it was the wrong thing to do, so just put me \nback where I was.\n\nAnyway, that was my thought pattern.  Since that isn't how it works, \nI'll just have to remember where I was when I started the rebase, \nperform the abort, and checkout the originating branch.\n\nThank you for your time.\n\nJosh\n"},{"id":"154639","messageId":"m3wrp2gufb.fsf@localhost.localdomain","threadId":"25525","inReplyTo":"4CC8E84C.3030709@workspacewhiz.com","subject":"Re: git rebase --abort of an --onto run does not checkout the originating branch","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-10-28T16:22:08Z","receivedAt":"2010-10-28T16:22:08Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Joshua Jensen <jjensen@workspacewhiz.com> writes:\n\n> I'll just have to remember where I was when I started the rebase,\n> perform the abort, and checkout the originating branch.\n\n\"git checkout -\" (or its generalization \"git checkout @{-<n>}\").\n\nP.S. This is discounting whether there is bug in \"git rebase --abort\"\nafter using it with `--onto` or not.\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}