git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Hherr.kaste <herr.kaste@gmail.com>
Date
Nov 3, 2020, 11:02 UTC
Message-ID
<CAFzd1+5D4pHhGf=K0LwaaOUjoBByqsMTpBVtR+Ots6-afBTDEA@mail.gmail.com>
In-Reply-To
<xmqqpn4vqogu.fsf@gitster.c.googlers.com>
Am Di., 3. Nov. 2020 um 01:21 Uhr schrieb Junio C Hamano <gitster@pobox.com>:
Show 16 quoted lines
>
> "herr.kaste" <herr.kaste@gmail.com> writes:
>
> > 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.
>
> What "two"?  You should be able to just say @{1} regardless---that
> was the whole point of performing all the intermediate steps while
> on the detached HEAD so that you can rely on <n> being 1, and @{<num
> or time>} is a short-hand of <branch>@{<num or time>} for the
> current branch, and not a short-hand for HEAD@{...}, to help such a
> use case.
>
> Or am I missing something?

Well, "@{1}" basically means: from the stream of things that happened take the first. It is very natural to refer to the most recent thing differently. In practice, until now, I used the {...} form only to refer to older things. To put it differently, using {...} I'm researching history.

From the docs:
    ORIG_HEAD is created by commands that move your HEAD in a drastic way,
    to record the position of the HEAD before their operation, so that you
    can easily change the tip of the branch back to the state before you ran
    them.

That's just humane. You do something, and then you revert. I don't need a concept of a written history here, just of recency.

Previous: Junio C HamanoNext: Phillip Wood via GitGitGadget
Message 9 of 15 in “rebase -i: fix ORIG_HEAD handling”
  1. 0/4 rebase -i: fix ORIG_HEAD handlingPhillip Wood via GitGitGadget, Oct 27, 2020
  2. 4/4 rebase -i: simplify get_revision_ranges()Phillip Wood via GitGitGadget, Oct 27, 2020
  3. 3/4 rebase -i: use struct object_id when writing statePhillip Wood via GitGitGadget, Oct 27, 2020
  4. 1/4 rebase -i: stop overwriting ORIG_HEAD bufferPhillip Wood via GitGitGadget, Oct 27, 2020
  5. Junio C HamanoOct 27, 2020
  6. Phillip WoodOct 31, 2020
  7. herr.kasteNov 2, 2020
  8. Junio C HamanoNov 3, 2020
  9. herr.kasteNov 3, 2020
  10. 2/4 rebase -i: use struct object_id rather than looking up commitPhillip Wood via GitGitGadget, Oct 27, 2020
  11. 0/4 rebase -i: fix ORIG_HEAD handlingPhillip Wood via GitGitGadget, Nov 4, 2020
  12. 1/4 rebase -i: stop overwriting ORIG_HEAD bufferPhillip Wood via GitGitGadget, Nov 4, 2020
  13. 3/4 rebase -i: use struct object_id when writing statePhillip Wood via GitGitGadget, Nov 4, 2020
  14. 4/4 rebase -i: simplify get_revision_ranges()Phillip Wood via GitGitGadget, Nov 4, 2020
  15. 2/4 rebase -i: use struct object_id rather than looking up commitPhillip Wood via GitGitGadget, Nov 4, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.