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

Re: [PATCH v3] git checkout: create unparented branch by --orphan

From
Chris Johnsen <chris_johnsen@pobox.com>
Date
Mar 22, 2010, 12:46 UTC
Message-ID
<953BEDE2-1A17-49EA-BEC5-D198DBB1FF23@pobox.com>
In-Reply-To
<55bacdd31003211415k79b7a039n3f19eb95eefcad43@mail.gmail.com>
2010/3/21 Junio C Hamano <gitster@pobox.com>:
Show 8 quoted lines
> The main point of the feature is not the emptyness of the resulting  
> tree
> (it is merely one possible outcome), but is the lack of parents in the
> resulting commit.  So I would recommend against --empty.  --root  
> might be
> a good synonym, though, and we _do_ already use that word for that  
> purpose
> in some commands (e.g. "log --root").
On 2010 Mar 21, at 16:15, Erick Mattos wrote:
> --root could be a synonym but the reason I haven't chosen it was the
> fact that it could mislead people to think the functionality will do
> something with/based on the first commit of the actual branch,
> subjectively thinking "THE ROOT".

The existing uses of --root are close to, but not identical to this proposed usage. The existing uses all relate to handling the already created root commit(s) of a commit/branch/repository. This proposed usage relates to the yet to be created first commit on the new branch. It is possible to use the "already created" interpretation in this context (create a new branch based on the root commits of the specified commits), but it really does not make much sense. Still, qualifying "root" might help prevent some confusion:

     --new-root
     --fresh-root
     --root-branch?
     --new-history
     --fresh-history
     --fresh-branch

Logically, both --orphan and --root are descriptions of the commit that will _eventually_ be stored under the branch, but not descriptions of the transient state of the branch itself. This state is described in a few error/warning messages as "not yet born" or "unborn" (checkout, pull, fsck). It seems to be an unofficial term though (or maybe just unimportant) since it is not otherwise documented (it is not in the glossary, but it does appear in the release notes a few times). So with some weight of existing terminology behind it:

     --unborn

--no-parent was mentioned elsewhere in the thread, but it suffers from looking like a negation of a potential --parent option. Though much longer, --without- does not suffer this same problem.

     --without-parents
     --without-history
     --ahistorically    (probably the non-standard prefix is too  
"native")
     --ex-nihilo        (just kidding?)
-- 
Chris
Previous: Michael J GruberNext: Erick Mattos
Message 7 of 13 in “git checkout: create unparented branch by --orphan”
  1. git checkout: create unparented branch by --orphanErick Mattos, Mar 21, 2010
  2. Peter BaumannMar 21, 2010
  3. Erick MattosMar 21, 2010
  4. Junio C HamanoMar 21, 2010
  5. Erick MattosMar 21, 2010
  6. Michael J GruberMar 22, 2010
  7. Chris JohnsenMar 22, 2010
  8. Erick MattosMar 22, 2010
  9. Junio C HamanoMar 21, 2010
  10. Chris JohnsenMar 22, 2010
  11. Erick MattosMar 22, 2010
  12. Translating error messages in Git (was: Re: [PATCH v3] git checkout: create unparented branch by --orphan)Jakub Narebski, Mar 22, 2010
  13. Junio C HamanoMar 22, 2010

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.