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

Re: Clone from shallow bundle bug

From
PSPhillip Susi <psusi@ubuntu.com>
Date
Apr 1, 2015, 02:56 UTC
Message-ID
<551B5E64.9070906@ubuntu.com>
In-Reply-To
<xmqqbnj8q0bm.fsf@gitster.dls.corp.google.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 03/31/2015 06:17 PM, Junio C Hamano wrote:
Show 9 quoted lines
> Phillip Susi <psusi@ubuntu.com> writes:
> 
>> I made a shallow clone of my repo, then used git bundle create to
>> pack it all into a bundle file, then cloned from that bundle.
> 
> I think the introdution of shallow clone feature broke git bundle
> create by not teaching it that its shallow boundaries are
> prerequisite commits to unbundle its contents.  IOW, the bundle
> created from the shallow clone is broken, I would think.

It seems to me that it isn't exactly broken; it just needs to put something in the bundle noting that it was built from a shallow clone, and then when cloning from the shallow bundle, the new clone needs its .git/shallow file.

In other words, the bundle contains all of the objects in the shallow clone, so a new shallow clone can be correctly constructed from the bundle, it's just that the new clone doesn't *know* it too is shallow and things like git log and gitk need to stop following the history chain when they reach the shallow point rather than complain that the rest of the history is missing ( which is intentional ).

For that matter, if you do create a depth limited bundle from a non shallow repository, then try to clone from it, the cloned repo should automatically become shallow rather than complain about missing history.

In other words, any time you clone from a bundle, the clone process should check if the full history is in the bundle, and if not, automatically make the new repo shallow so as to avoid the error messages about the missing history.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBCgAGBQJVG15kAAoJENRVrw2cjl5RnvgH/iMyN/1U2zg+ju/teVEQIMRL prvC60S9/yLxSp6RmiXpN2xuGHMkn7i2y6XpM9RQdE6ETeGaIw7UaDan3r7BPTSD +Q9DrAM0g17IGNxvmGPiJZP7j0t2e43oTA9KM8alf6icMU/mWJgQsbtc9QFVfVkd jsYevK1GR6ysrAHBAV6GxKfNw5yw3N+kTf9s2rKXWIFaArD0rcKJZVxiygMlhVSa hT4j3+n5f3n0WMDVxFzhwOaW+yrPiXF3gs1pKFX8GT5g1BtvOAEnyskSgA5nZsNB G53ncyyefinaaBqCvPSbcTLXmWLV8QuLBExc13BWXiVUD2rRNQr7u1ihbxWKyvU= =D90B -----END PGP SIGNATURE-----

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 16 in “Clone from shallow bundle bug”
  1. Phillip SusiMar 31, 2015
  2. Junio C HamanoMar 31, 2015
  3. Phillip SusiApr 1, 2015
  4. Junio C HamanoApr 1, 2015
  5. Duy NguyenApr 1, 2015
  6. Phillip SusiApr 1, 2015
  7. Junio C HamanoApr 1, 2015
  8. Duy NguyenApr 2, 2015
  9. Duy NguyenApr 2, 2015
  10. Phillip SusiApr 2, 2015
  11. Duy NguyenApr 1, 2015
  12. Phillip SusiApr 1, 2015
  13. Duy NguyenApr 1, 2015
  14. Phillip SusiApr 1, 2015
  15. Duy NguyenApr 1, 2015
  16. Phillip SusiApr 1, 2015

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.