{"thread":{"id":"48243","subject":"After a rebase, ORIG_HEAD points to the previous tip of the branch?","startedAt":"2018-04-08T21:10:42Z","lastAt":"2018-04-08T23:04:19Z","messageCount":2,"participants":["Ilya Kantor","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"344115","messageId":"CAFU8umhSAufzbPBDMVt4ekcWjPa4Yymh+NeW=BYa8ARuRuZcbw@mail.gmail.com","threadId":"48243","inReplyTo":null,"subject":"After a rebase, ORIG_HEAD points to the previous tip of the branch?","fromName":"Ilya Kantor","fromEmail":"iliakan@gmail.com","sentAt":"2018-04-08T21:10:16Z","receivedAt":"2018-04-08T21:10:42Z","isPatch":false,"sender":{"key":"iliakan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349336?v=4"},"body":"Hi,\n\nImmediately after a finished rebase, is it true that ORIG_HEAD points\nto the previous tip of the branch?\n\nSo that `git reset --hard ORIG_HEAD` will cancel the rebase?\n\nP.S. I'm asking because most of time that is so, but there is at least\none case when ORIG_HEAD breaks that assumption. Not sure if it's a bug\nor not.\n\n---\nBest Regards,\nIlya Kantor\n"},{"id":"344120","messageId":"xmqqy3hx8fmb.fsf@gitster-ct.c.googlers.com","threadId":"48243","inReplyTo":"CAFU8umhSAufzbPBDMVt4ekcWjPa4Yymh+NeW=BYa8ARuRuZcbw@mail.gmail.com","subject":"Re: After a rebase, ORIG_HEAD points to the previous tip of the branch?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-04-08T23:04:12Z","receivedAt":"2018-04-08T23:04:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ilya Kantor <iliakan@gmail.com> writes:\n\n> Immediately after a finished rebase, is it true that ORIG_HEAD points\n> to the previous tip of the branch?\n>\n> So that `git reset --hard ORIG_HEAD` will cancel the rebase?\n\nI wouldn't recommend people to depend on it; rather use \"@{1}\",\nperhaps?\n\nBefore reflog was invented, ORIG_HEAD was primarily a handy way to\nback out of \"reset\", but because the implementation of higher-level\nporcelains like \"rebase\" may internally use things like \"reset\"\nwithout giving it much thought about clobber ingORIG_HEAD (largely\nbecause there is an expectation that modern end users would be using\nreflog more than old-way ORIG_HEAD), cases like stopping in conflict\nand getting told to skip and continue may not preserve ORIG_HEAD as\nyou wish it to.\n"}]}