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

Weird shallow-tree conversion state, and branches of shallow trees

From
Robin H. Johnson <robbat2@gentoo.org>
Date
Apr 12, 2007, 00:53 UTC
Message-ID
<20070412005336.GA18378@curie-int.orbis-terrarum.net>

I was doing some random tests with shallow trees, and ran into two issues - the first is a shallow tree that doesn't extend anymore when it should, and the second is some branched shallow tree trouble.

1. (I was using the kernel.org Git repo for my testing here)

> git clone --depth 1 git://GIT-REMOTE-URL
> # do some local commits
> git pull --depth 1000000 # some very large number, to try and add all the history

At this point, I noticed that my tree still seemed to be shallow, and no matter what I tried, I couldn't un-shallow it.

.git/shallow contained a single line:
> 9c405082d96ed7a7ed830f9861dbad9a32e4d268
And moving the shallow file out the way, fsck --full gets me:
Show 6 quoted lines
> broken link from  commit 9c405082d96ed7a7ed830f9861dbad9a32e4d268
>               to  commit bb3e781d7f6259eb414cbecd8bad74cd4a188b41
> broken link from  commit 9c405082d96ed7a7ed830f9861dbad9a32e4d268
>               to  commit 9bfbe261923f4e9d89f65e6755fa6501aa6531b0
> missing commit bb3e781d7f6259eb414cbecd8bad74cd4a188b41
> missing commit 9bfbe261923f4e9d89f65e6755fa6501aa6531b0

Any ideas on why it's not going to full depth? I don't have a reliable test case for this yet, sometimes it does go deep properly, sometimes it doesn't.

2. Again about shallow repos, a development problem I ran into.

Show 8 quoted lines
> git clone --depth 1 git://GIT-REMOTE-URL
> git checkout -b working-branch
> # do various work, and git-commit the changes
> git checkout master 
> git pull
> # some time goes by, and you want the latest upstream changes
> git checkout working-branch
> git pull . master

The last pull from the local master fails. This seems weird, because if working-branch development is done on the master instead, the earlier pull never complains. So in this case, the working-branch should be able to pull from the local master branch fine.

This bug basically stops people from being able to take a shallow clone of a repository with a lot of history, and have multiple working branches on it.

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Council Member
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
Next: Johannes Schindelin
Message 1 of 34 in “Weird shallow-tree conversion state, and branches of shallow trees”
  1. Robin H. JohnsonApr 12, 2007
  2. Johannes SchindelinApr 14, 2007
  3. Robin H. JohnsonApr 15, 2007
  4. David LangApr 15, 2007
  5. Robin H. JohnsonApr 15, 2007
  6. Shawn O. PearceApr 15, 2007
  7. Nguyen Thai Ngoc DuyApr 15, 2007
  8. Jakub NarebskiApr 15, 2007
  9. Linus TorvaldsApr 15, 2007
  10. Andy ParkinsApr 15, 2007
  11. Linus TorvaldsApr 15, 2007
  12. Bill LearApr 16, 2007
  13. Andy ParkinsApr 16, 2007
  14. Julian PhillipsApr 16, 2007
  15. Robin H. JohnsonApr 16, 2007
  16. Theodore TsoApr 16, 2007
  17. Nguyen Thai Ngoc DuyApr 16, 2007
  18. Linus TorvaldsApr 16, 2007
  19. Nguyen Thai Ngoc DuyApr 16, 2007
  20. Robin H. JohnsonApr 16, 2007
  21. Linus TorvaldsApr 16, 2007
  22. Daniel BarkalowApr 17, 2007
  23. Linus TorvaldsApr 16, 2007
  24. Andy ParkinsApr 16, 2007
  25. Sven VerdoolaegeApr 16, 2007
  26. Linus TorvaldsApr 16, 2007
  27. David LangApr 16, 2007
  28. David LangApr 17, 2007
  29. Andy ParkinsApr 17, 2007
  30. Junio C HamanoApr 16, 2007
  31. Andy ParkinsApr 16, 2007
  32. Junio C HamanoApr 17, 2007
  33. Andy ParkinsApr 17, 2007
  34. Robin H. JohnsonApr 15, 2007

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.