Re: [PATCH 1/4] rebase -i: stop overwriting ORIG_HEAD buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Di., 27. Okt. 2020 um 22:10 Uhr schrieb Junio C Hamano <gitster@xxxxxxxxx>:
>
> My initial impression after seeing the recent report about ORIG_HEAD
> was "hmph, these days, rebasing is done on detached HEAD and the
> final step updates the target branch only once, so @{1} is much
> easier to use---perhaps it is time to deprecate use of ORIG_HEAD?".
> After all, ORIG_HEAD was invented way before we had reflog, and
> given that one of the goal of reflog was to give more general
> recovery mechanism than going back one-step like ORIG_HEAD allowed
> us to, and "rebase" were taught to work on detached HEAD to make
> @{1} more useful, it would not be too bad to eventually retire
> ORIG_HEAD in a distant future, I thought.

Phillip pointed out that ORIG_HEAD is actually not save *if* there is
a `reset` or `rebase --skip` during the rebase.  Otherwise, by design,
ORIG_HEAD would be easier to use, as in the form `<branch_name>@{<n>}`
two things have to be decided and can go wrong.

Wouldn't it be better for the mid-term run to set ORIG_HEAD at the end
of the rebase operation, basically during cleanup, and make the commitment
that it always points to the right thing for undoing the recent rebase
or to compare it (`git diff ORIG_HEAD`) to see possible unwanted merge
resolutions.

I say mid-term because a `git rebase --undo` with additional safety checks
and a `--autostash` for example is IMO the better long-run UX, in a very
distant future.

>
> But it is a good initiative anyway to make ORIG_HEAD again work as
> documented.  Thanks for working on it.
>

Regards
Caspar Duregger



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux