Subject: Re: Orphan branch not well-defined?

From: Junio C Hamano <[email-masked]>
Date: Fri, 24 Nov 2023 11:12:00 +0900

Junio C Hamano <[email-masked]> writes:

> Chris Torek <[email-masked]> 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.