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

Re: is ORIG_HEAD allowed to point to a non-existing object?

From
Junio C Hamano <gitster@pobox.com>
Date
May 10, 2016, 18:14 UTC
Message-ID
<xmqqinylpyq9.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAENte7jNxM7J9bWUnrOkLQJZ=8JEtYzw9-uxVkq-CpvGyk9UUw@mail.gmail.com>
Christian Halstrick <christian.halstrick@gmail.com> writes:
Show 5 quoted lines
> If I do a "git-rebase -i ..." followed by "git reflog expire ..." and
> "git gc ..." then I can end up with a repo which has a ref ORIG_HEAD
> which points to a non-existing object.
>
> - Is this intended?
Yes.

HEAD is a ref, but other things like MERGE_HEAD, ORIG_HEAD, FETCH_HEAD are not considered as refs and they are intended to be temporary. This does mean that they will become invalid if you prune objects that are only reachable from them, but your "reflog expire && gc" falls into "if it hurts, don't do it".

Previous: Christian Halstrick
Message 2 of 2 in “is ORIG_HEAD allowed to point to a non-existing object?”
  1. Christian HalstrickMay 10, 2016
  2. Junio C HamanoMay 10, 2016

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.