Re: git rebase: retain original head?
- From
- Markus Wiederkehr <markus.wiederkehr@gmail.com>
- Date
- Jan 8, 2019, 20:38 UTC
- Message-ID
- <CA+h-BnvN7+ETU-vFxAGDvs0gvXUjAAhMkvTPUxoRTt2Gb4b2ow@mail.gmail.com>
- In-Reply-To
- <87va2zavu1.fsf@igel.home>
On Tue, Jan 8, 2019 at 6:43 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
Show 7 quoted lines
> > On Jan 08 2019, Markus Wiederkehr <markus.wiederkehr@gmail.com> wrote: > > > Would it be possible to retain this information? > > You could use the reflog of the current branch, where it is the second > entry.
It is not, depending on what happens in the rebase it could be any entry. That's why I always have to search for the right one, which is tedious.
Example:
$ git rebase -i root-tag ... (apply one fixup) $ git reflog 906caf1c (HEAD -> master) HEAD@{0}: rebase -i (finish): returning to refs/heads/master 4906caf1c (HEAD -> master) HEAD@{1}: rebase -i (pick): qux 85dab37b4 HEAD@{2}: rebase -i (pick): baz 7de7420d2 HEAD@{3}: rebase -i (fixup): bar 9bc0461c0 HEAD@{4}: rebase -i (start): checkout root-tag a150b73ca HEAD@{5}: commit: foo
Here I have to use HEAD@{5}.Markus
On Tue, Jan 8, 2019 at 6:43 PM Andreas Schwab <schwab@linux-m68k.org> wrote:
Show 18 quoted lines
> > On Jan 08 2019, Markus Wiederkehr <markus.wiederkehr@gmail.com> wrote: > > > During the rebase operation the original head seems to get stored in > > 'rebase-merge/orig-head'. Unfortunately this references gets removed > > after the rebase operation completes. > > > > Would it be possible to retain this information? > > You could use the reflog of the current branch, where it is the second > entry. > > Andreas. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 > "And now for something completely different."