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

Re: Document clone of clone ... bug??

From
VHVaclav Hanzl <hanzl@noel.feld.cvut.cz>
Date
Jun 14, 2008, 20:15 UTC
Message-ID
<20080614.221511.74741328.hanzl@noel.feld.cvut.cz>
In-Reply-To
<20080614143117.GA8640@sigill.intra.peff.net>
> The clone of clone does not have dangling objects; either it sees a ref
> (because it is a branch in the clone) and it grabs the objects, or it
> does not see it, in which case it does not download those objects.

Yes, there should not be a dangling object, but I actually got one. I was surprised, but I thought it is just an undocumented benign behavior (optimization overkill - clone rather gets those objects instead of thinking what it needs). Now I think it may be a bug.

Can someone with deeper knowledge and fresh git please try this:
 rm -rf A B C
 mkdir A B C
 (cd A; mkdir X; cd X; git init; echo x>x; git add x; git commit -m xxx;
  git checkout -b br; echo y>y; git add y; git commit -m yyy;
  git checkout master)
 (cd B; git clone ../A/X)
 (cd C; git clone ../B/X; cd X; git fsck --full)
With my 11 days old version of git, I get:
 dangling commit ...

and 'git show ...' reveals that this commit it that otherwise (rightfully) lost branch 'br'.

SHA1 is changing when I repeat this (due to dates in reflogs??).
When I omit 'git checkout master', no dangling commit appears. Strange.
Is it my faulty thinking, benign undocumented thing, or a bug?
Vaclav Hanzl
Previous: Jeff KingNext: Jakub Narebski
Message 3 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.