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

Can we make git clone --recurse-submodules --shallow-submodules work for commits that are not on tags or branches

From
Ciro Santilli <ciro.santilli@gmail.com>
Date
Feb 14, 2018, 05:06 UTC
Message-ID
<CAFXrp_cP-WaXO27VV1OcVakfmDX0b6M62Qz1j4XRCbtQJzFfnw@mail.gmail.com>

I have a git repo with large submodules, notably the Linux kernel, and shallow clone saves a lot of time.

However, QEMU is also a submodule, which I don't control, and QEMU has submodules which don't point to commits that are not on any tag or branch, so:

 git clone --recurse-submodules --shallow-submodules git://git.qemu.org/qemu.git
currently fails with:

error: Server does not allow request for unadvertised object 22ead3e0bfdb87516656453336160e0a37b066bf Fetched in submodule path 'capstone', but it did not contain 22ead3e0bfdb87516656453336160e0a37b066bf. Direct fetching of that commit failed.

on git 2.16.1.

Furthermore, I reproduce this locally with direct filesystem clones: https://github.com/cirosantilli/test-git-web-interface/blob/15335d3002a3e64fc5756b69fb832a733aa63fb9/shallow-submodule.sh#L158 and on GitHub, so I'm guessing it is not just the settings for a specific server?

Would it be possible to make that work, or are there fundamental reasons why it is not possible?

Here is my use case repo, at the point of the ugly workaround I'm having to do: https://github.com/cirosantilli/linux-kernel-module-cheat/blob/a14c95346cfd9d2e7b2e475b0981aa71d819c20b/configure#L23

Some more context: https://stackoverflow.com/questions/2144406/git-shallow-submodules/47374702#47374702

This would make some embedded people happy.
Next: Stefan Beller
Message 1 of 2 in “Can we make git clone --recurse-submodules --shallow-submodules work for commits that are not on tags or branches”
  1. Ciro SantilliFeb 14, 2018
  2. Stefan BellerFeb 14, 2018

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.