From: Erik Cervin Edin <erik@cervined.in>
To: phillip.wood@dunelm.org.uk
Cc: git@vger.kernel.org
Subject: Re: bug?: ORIG_HEAD incorrect after reset during git-rebase -i
Date: Thu, 16 Dec 2021 17:44:02 +0100 [thread overview]
Message-ID: <CA+JQ7M9G8HqqieRAK3C6csMM93PHOmaMd8GMPrDEfogWG0bteA@mail.gmail.com> (raw)
In-Reply-To: <e6adaad6-f6ee-57d3-dc8f-d14a760c57c2@talktalk.net>
Hi Phillip,
Yes, I know.
It's just that I was under the impression ORIG_HEAD was to be reverted
to .git/rebase-merge/orig-head at the finish of the rebase.
Personally, it's the behavior I would expect.
Thanks for the tips.
Regards,
Erik
On Thu, Dec 16, 2021 at 5:27 PM Phillip Wood <phillip.wood@talktalk.net> wrote:
>
> Hi Erik
>
> On 16/12/2021 14:30, Erik Cervin Edin wrote:
> > Steps to reproduce:
> > 1. git-rebase -i
> > 2. edit XYZ
> > 3. git-reset HEAD~
>
> "git reset" will update ORIG_HEAD to the current HEAD before resetting
> so here ORIG_HEAD gets updated to point to XYZ
>
> > 4. git-commit -C ORIG_HEAD -a
> > 5. git-rebase --continue
> > 6. git-show ORIG_HEAD
> >
> > Expected behavior:
> > ORIG_HEAD should point at the previous HEAD of the rebased branch
> >
> > Actual behavior:
> > ORIG_HEAD points to XYZ
> >
> > My understanding from reading https://stackoverflow.com/a/64949884 is
> > that this is incorrect behavior.
> >
> > Perhaps this is as intended but I would at least personally prefer
> > that ORIG_HEAD would point to the previous HEAD of the rebased branch.
>
> You can use the reflog to get the previous HEAD of the rebased branch
> after rebasing. Immediately after the rebase branch-name@{1} will point
> to the pre-rebase HEAD.
>
> Best Wishes
>
> Phillip
>
>
> > Seen in:
> > git version 2.31.1.windows.1
> >
> > Possibly related to
> > e100bea481 - rebase -i: stop overwriting ORIG_HEAD buffer
>
--
Erik Cervin-Edin
Erik.CervinEd.in
next prev parent reply other threads:[~2021-12-16 16:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 14:30 bug?: ORIG_HEAD incorrect after reset during git-rebase -i Erik Cervin Edin
2021-12-16 16:27 ` Phillip Wood
2021-12-16 16:44 ` Erik Cervin Edin [this message]
2023-01-05 0:11 ` Philippe Blain
2023-01-06 14:29 ` Phillip Wood
2023-01-07 17:06 ` Philippe Blain
2023-01-07 19:50 ` Philippe Blain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+JQ7M9G8HqqieRAK3C6csMM93PHOmaMd8GMPrDEfogWG0bteA@mail.gmail.com \
--to=erik@cervined.in \
--cc=git@vger.kernel.org \
--cc=phillip.wood@dunelm.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).