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

Re: [PATCH] Documentation: Note about the meaning of "clone"

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 15, 2008, 20:14 UTC
Message-ID
<7vskvecv6d.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<200806151505.27686.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:
Show 22 quoted lines
> Clarify that a clone is not an exact copy.
>
> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
> ---
>  Documentation/git-clone.txt |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
> index 7973e6a..c9bc627 100644
> --- a/Documentation/git-clone.txt
> +++ b/Documentation/git-clone.txt
> @@ -31,7 +31,12 @@ This default configuration is achieved by creating references to
>  the remote branch heads under `$GIT_DIR/refs/remotes/origin` and
>  by initializing `remote.origin.url` and `remote.origin.fetch`
>  configuration variables.
> -
> ++
> +*NOTE*: Although this command is called clone, the clone is not identical
> +in all respects. Local branches in the repository being cloned
> +becomes remote tracking branches in the clone and remote tracking
> +branches are not cloned at all. For security reasone the config sections
> +and triggers are not cloned either.
Thanks.

But the above will not lose any information content if "Although... clone," is dropped. It in fact, dropping that would make it even clearer.

Saying only "beware that neither X nor Y nor Z is done" leaves readers wondering "why not". Saying "you may assume W but that is not the case" is the same. How about expressing it a bit differently and in a more positive way? Documentation is not a place to express your frustration you felt immediately after you found out that your initial assumption did not match reality.

And there is no triggers in git. If you are improving documentation, please get your terminology straight.

I think the first three paragraphs of this manual page need major overhaul. There were not much difference between bare and non-bare clone when historical layout was used, but exactly because a clone with a working tree always use separate remotes layout, what they do is vastly different these days.

Points to stress, and the order to present them, in the rewritten first paragraphs would be:

 - There are two different kind of clones.  A bare one and non bare one.
 - A non-bare one is a way to prepare where you work in.  It is assumed
   that you will want to keep updating the resulting repository from the
   source of the cloning operation from time to time, so 'origin' is set
   up for you automatically to track its branches in remotes/origin.
 - A bare one is a way to prepare where you push into so that others can
   fetch from it.  IOW, it is a place people meet to exchange history, not
   a place where somebody actually works in to build history.  It is
   expected that people will push into the resulting repository from
   elsewhere to update it, rather than somebody will fetch into it further
   from any 'origin'.  No 'origin' is made, and branches are copied 1:1.
 - In either case, only the information from the originating repository
   that are designed to be shared are propagated.  That includes branches
   and tags, but not things that are specific for working in the
   originating repository such as config, stash, hooks and remote tracking
   branches.
Previous: Miklos VajnaNext: Robin Rosenberg
Message 19 of 20 in “Document clone of clone loosing branches?”
  1. Vaclav HanzlJun 14, 2008
  2. Jeff KingJun 14, 2008
  3. Vaclav HanzlJun 14, 2008
  4. Jakub NarebskiJun 14, 2008
  5. Vaclav HanzlJun 14, 2008
  6. Jakub NarebskiJun 14, 2008
  7. Lea WiemannJun 14, 2008
  8. Vaclav HanzlJun 14, 2008
  9. Junio C HamanoJun 14, 2008
  10. Vaclav HanzlJun 15, 2008
  11. Jakub NarebskiJun 14, 2008
  12. Jakub NarebskiJun 15, 2008
  13. Documentation: Note about the meaning of "clone"Robin Rosenberg, Jun 15, 2008
  14. Jakub NarebskiJun 15, 2008
  15. Wincent ColaiutaJun 15, 2008
  16. Vaclav HanzlJun 15, 2008
  17. Vaclav HanzlJun 15, 2008
  18. Miklos VajnaJun 15, 2008
  19. Junio C HamanoJun 15, 2008
  20. PATCH] cvsimport: Clarification on the use of -rRobin Rosenberg, Jun 15, 2008

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.