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:48 UTC
Message-ID
<20080614.224840.41641579.hanzl@noel.feld.cvut.cz>
In-Reply-To
<m3skvfpxgp.fsf@localhost.localdomain>
Show 7 quoted lines
> _Local_ clone?  This is result of optimization; in cloning over local
> filesystem case git-clone simply hardlinks object database (if
> possible) instead of transferring objects.  This was only on request
> in earlier versions of git.
>
> You can use filr:// protocol to force generating of pack-file and
> actual transfer of objects.
Still dangling even with 'file:', using (in my case) this:
 pwd
 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 y; echo y>y; git add y; git commit -m yyy;
  git checkout master)
 (cd B; git clone file:///home/kroupa/tmp/gittest/A/X; cd X; git branch -a)
 (cd C; git clone file:///home/kroupa/tmp/gittest/B/X; cd X; git branch -a; git fsck --full)
The actual result of pasting this to shell is:

~/tmp/gittest>pwd /home/kroupa/tmp/gittest ~/tmp/gittest>rm -rf A B C ~/tmp/gittest>mkdir A B C ~/tmp/gittest>(cd A; mkdir X; cd X; git init; echo x>x; git add x; git commit -m xxx;

>  git checkout -b y; echo y>y; git add y; git commit -m yyy;
>  git checkout master)
Initialized empty Git repository in .git/
Created initial commit ec59a7e: xxx
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 x
Switched to a new branch "y"
Created commit 2be193d: yyy
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 y
Switched to branch "master"
~/tmp/gittest>(cd B; git clone file:///home/kroupa/tmp/gittest/A/X; cd X; git branch -a)
Initialized empty Git repository in /home/kroupa/tmp/gittest/B/X/.git/
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
* master
  origin/HEAD
  origin/master
  origin/y
~/tmp/gittest>(cd C; git clone file:///home/kroupa/tmp/gittest/B/X; cd X; git branch -a; git fsck --full)
Initialized empty Git repository in /home/kroupa/tmp/gittest/C/X/.git/
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 6 (delta 0)
Receiving objects: 100% (6/6), done.
* master
  origin/HEAD
  origin/master
dangling commit 2be193dc7dc3e1051dcf5af9d03f7587b61f9fc3
And the dangling object is:
~/tmp/gittest>cd C/X; git show 2be193d
commit 2be193dc7dc3e1051dcf5af9d03f7587b61f9fc3
Author: kroupa <kroupa@noli.localdomain>
Date:   Sat Jun 14 22:47:46 2008 +0200
    yyy
diff --git a/y b/y
new file mode 100644
index 0000000..975fbec
--- /dev/null
+++ b/y
@@ -0,0 +1 @@
+y



Any thoughts?

Vaclav
Previous: Jakub NarebskiNext: Jakub Narebski
Message 5 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.