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

Re: Clone from shallow bundle bug

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 1, 2015, 06:31 UTC
Message-ID
<xmqqtwx0mka8.fsf@gitster.dls.corp.google.com>
In-Reply-To
<551B5E64.9070906@ubuntu.com>
Phillip Susi <psusi@ubuntu.com> writes:
Show 13 quoted lines
> On 03/31/2015 06:17 PM, Junio C Hamano wrote:
>> 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 ...
I think you are saying the same thing as I did without realizing ;-)

The only way a bundle can record "something" "noting" that it is an incomplete history, while allowing it to be read by existing implementations of "git bundle unbundle" is to list the commits, behind which there is no history available in the bundle, as bundle's pre-requisites. I said that the addition of shallow repository support did not enhance "git bundle create" to do so, and you are saying "it just needs to put", implying that it currently does not.

Now, the only way the existing implementations of "git bundle unbundle" can extract from such a bundle with prerequisites is to unbundle into a repository that satisifies the prerequisites (these incomplete bundle files are designed as a medium for sneaker-net incremental updates). I however suspect "git clone --shallow" from such a bundle _might_ work (I never tried it), but I wouldn't be surprised if the existing implementations of bundle unpacking code refused to unbundle into a repository that lacks prerequiste commits (i.e. making the repository a shallow-clone).

Allowing "git clone" (without "--shallow") from an incomplete bundle file create a shallow clone, instead of outright refusing to work or silently creating a corrupt repository, might be an interesting project, perhaps the right size for GSoC or something like that.

Patches welcome, but one thing whoever is doing such a patch needs to be careful about is that the pack data in the bundle is likely to be a thin one---truly requiring the repository the bundle is unpacked into to have the prerequisite objects.

Previous: Phillip SusiNext: Duy Nguyen
Message 4 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.