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

Re: [RFC/PATCH] clone: add `--shallow-submodules` flag

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 12, 2016, 00:41 UTC
Message-ID
<xmqqa8m4a5nx.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1457739683-1972-1-git-send-email-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 20 quoted lines
> When creating a shallow clone of a repository with submodules, the depth
> argument does not influence the submodules, i.e. the submodules are done
> as non-shallow clones. It is unclear what the best default is for the
> depth of submodules of a shallow clone, so we need to have the possibility
> to do all kinds of combinations:
>
> * shallow super project with shallow submodules
>   e.g. build bots starting always from scratch. They want to transmit
>   the least amount of network data as well as using the least amount
>   of space on their hard drive.
> * shallow super project with unshallow submodules
>   e.g. The superproject is just there to track a collection of repositories
>   and it is not important to have the relationship between the repositories
>   intact. However the history of the individual submodules matter.
> * unshallow super project with shallow submodules
>   e.g. The superproject is the actual project and the submodule is a
>   library which is rarely touched.
>
> The new switch to select submodules to be shallow or unshallow supports
> all of these three cases.

I think something like this is necessary to prime the well, but the more important (and intereseting) bit is how this shallowness is going to be maintained and carried forward across the future updates to the top-level supermodule. A submodule that was cloned at depth=1 initially along with its supermodule when the latter was initially cloned does not have to be indefinitely kept at depth=1, and there would be a lot of creative ways to make it useful, but the creative and useful logic would need a piece of information to tell the future "submodule update" why the submodule repository is shallow to take into account, I would imagine.

It is somewhat curious that there is no hint left in the submodule repositories (e.g. their configfile) that they are originally created with an explicit user request "I said that I want these submodules to be cloned with depth=1", from that point of view.

Previous: Stefan BellerNext: Stefan Beller
Message 2 of 6 in “clone: add `--shallow-submodules` flag”
  1. clone: add `--shallow-submodules` flagStefan Beller, Mar 11, 2016
  2. Junio C HamanoMar 12, 2016
  3. Stefan BellerMar 12, 2016
  4. Junio C HamanoMar 12, 2016
  5. Stefan BellerMar 14, 2016
  6. Junio C HamanoMar 14, 2016

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.