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

Re: [PATCH] Docs: git checkout --orphan: `root commit' and `branch head'

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 27, 2011, 15:49 UTC
Message-ID
<4E81F080.7010905@drmicha.warpmail.net>
In-Reply-To
<e88b6e560cab4ed1937dd191b4180387-mfwitten@gmail.com>
Michael Witten venit, vidit, dixit 27.09.2011 16:43:
Show 31 quoted lines
> See:
> 
>   Re: Can a git changeset be created with no parent
>   Carlos Martín Nieto <cmn@elego.de>
>   Message-ID: <1317073309.5579.9.camel@centaur.lab.cmartin.tk>
>   http://article.gmane.org/gmane.comp.version-control.git/182170
> 
> and:
> 
>   git help glossary
> 
> Signed-off-by: Michael Witten <mfwitten@gmail.com>
> ---
>  Documentation/git-checkout.txt |   13 +++++--------
>  1 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
> index c0a96e6..c963a0f 100644
> --- a/Documentation/git-checkout.txt
> +++ b/Documentation/git-checkout.txt
> @@ -125,19 +125,16 @@ explicitly give a name with '-b' in such a case.
>  	below for details.
>  
>  --orphan::
> -	Create a new 'orphan' branch, named <new_branch>, started from
> -	<start_point> and switch to it.  The first commit made on this
> -	new branch will have no parents and it will be the root of a new
> -	history totally disconnected from all the other branches and
> -	commits.
> +	Tell git to make the next commit you make a root commit referenced by
> +	the branch head <new_branch>.

I recall objecting to the name "--orphan" (to no avail) because the first commit is the root commit and there is no "orphan branch nor "parent branch"...

In any case, I think the above is indeed an improvement, but I would keep at least something which connects to the misnamed option, e.g.

...root commit (i.e. without parents) referenced by...
Show 6 quoted lines
>  +
>  The index and the working tree are adjusted as if you had previously run
>  "git checkout <start_point>".  This allows you to start a new history
> -that records a set of paths similar to <start_point> by easily running
> +that records a set of paths similar to <start_point> by just running
>  "git commit -a" to make the root commit.
"similar" is an understatement here, maybe "as in"?
Show 8 quoted lines
>  +
> -This can be useful when you want to publish the tree from a commit
> -without exposing its full history. You might want to do this to publish
> +This can be useful when you want to publish a tree without exposing its
> +full history; for instance, you might want to do this to publish
>  an open source branch of a project whose current tree is "clean", but
>  whose full history contains proprietary or otherwise encumbered bits of
>  code.
+1 ;)
Michael
Previous: Michael WittenNext: Michael Witten
Message 28 of 57 in “Can a git changeset be created with no parent”
  1. vra5107Sep 25, 2011
  2. Andreas EricssonSep 25, 2011
  3. Carlos Martín NietoSep 25, 2011
  4. Junio C HamanoSep 26, 2011
  5. Carlos Martín NietoSep 26, 2011
  6. Docs: git checkout --orphan: `root commit' and `branch head'Michael Witten, Sep 27, 2011
  7. Matthieu MoySep 27, 2011
  8. Docs: git checkout --orphan: `root commit' and `branch head'Michael Witten, Sep 27, 2011
  9. Matthieu MoySep 27, 2011
  10. Michael WittenSep 27, 2011
  11. Matthieu MoySep 27, 2011
  12. Michael WittenSep 27, 2011
  13. Philip OakleySep 27, 2011
  14. Docs: git checkout --orphan: `root commit' and `branch head'Michael Witten, Sep 28, 2011
  15. Junio C HamanoSep 28, 2011
  16. Michael WittenSep 29, 2011
  17. Docs: git checkout --orphan: Copyedit, and s/root commit/orphan branch/Michael Witten, Sep 29, 2011
  18. Michael WittenSep 29, 2011
  19. Philip OakleySep 29, 2011
  20. Junio C HamanoSep 29, 2011
  21. Michael WittenSep 29, 2011
  22. Documentation/git-checkout.txt: Explain --orphan without introducing an undefined "orphan branch"Junio C Hamano, Sep 29, 2011
  23. Michael WittenSep 29, 2011
  24. Phil HordSep 29, 2011
  25. Michael WittenSep 29, 2011
  26. Phil HordSep 29, 2011
  27. Michael WittenSep 29, 2011
  28. Michael J GruberSep 27, 2011
  29. Michael WittenSep 27, 2011
  30. Junio C HamanoSep 27, 2011
  31. Michael WittenSep 27, 2011
  32. Eric RaibleSep 27, 2011
  33. Philip OakleySep 27, 2011
  34. Jeff KingSep 27, 2011
  35. Michael WittenSep 27, 2011
  36. Jeff KingSep 27, 2011
  37. Michael WittenSep 27, 2011
  38. Junio C HamanoSep 28, 2011
  39. Michael WittenSep 28, 2011
  40. Matthieu MoySep 28, 2011
  41. Michael WittenSep 28, 2011
  42. Matthieu MoySep 28, 2011
  43. Michael WittenSep 28, 2011
  44. Matthieu MoySep 28, 2011
  45. Michael WittenSep 28, 2011
  46. Junio C HamanoSep 28, 2011
  47. Jay SoffianSep 28, 2011
  48. Michael WittenSep 28, 2011
  49. Michael J GruberSep 28, 2011
  50. Junio C HamanoSep 29, 2011
  51. Phil HordSep 29, 2011
  52. Michael WittenSep 29, 2011
  53. Michael WittenSep 29, 2011
  54. Junio C HamanoSep 29, 2011
  55. Michael WittenSep 30, 2011
  56. Junio C HamanoSep 30, 2011
  57. Michael WittenSep 29, 2011

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.