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

Re: Orphan branch not well-defined?

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 24, 2023, 02:12 UTC
Message-ID
<xmqqplzz99xr.fsf@gitster.g>
In-Reply-To
<xmqqwmu79ac4.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> Chris Torek <chris.torek@gmail.com> writes:
>
>> ** Unborn Branch is the better term **
>
> Yes,  To orphan is a verb that denotes the act of becoming on an
> unborn branch, and a few references to "orphan branch" in our
> documentation are misuses of the word, I would have to say.

To be fair, the use of verb "orphan" by the folks first designed the "checkout --orphan" does make quite a lot of sense and it is very much consistent with the fact that the operation leaves the index and the working tree intact (unlike "switch --orphan" that empties the contents, which came much later).

The intended use case was that the user had the current set of contents that is desirable with history that is undesirable behind it, and wanted to part with the baggage^Whistory while keeping the end state. The operation was meant to be the first step to create a "parent-less" (aka "orphaned" from the parents in the original history) commit that records the desired state. It is the reason why "checkout --orphan" keeps the contents intact and moves the HEAD to be on an unborn branch.

Previous: Junio C HamanoNext: Eric Sunshine
Message 5 of 7 in “Orphan branch not well-defined?”
  1. Craig H MaynardNov 22, 2023
  2. Junio C HamanoNov 22, 2023
  3. Chris TorekNov 22, 2023
  4. Junio C HamanoNov 24, 2023
  5. Junio C HamanoNov 24, 2023
  6. Eric SunshineNov 24, 2023
  7. Junio C HamanoNov 24, 2023

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.