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

[RFC] submodule+shallow clone feature request

From
SDSchuyler Duveen <sky@columbia.edu>
Date
Feb 10, 2010, 21:39 UTC
Message-ID
<4B73277C.9010801@columbia.edu>

My use case is deploying from a git repository, which would be even more graceful with the following features:

1. When 'git clone' has both --recursive and --depth, then submodules
are also checked out shallow (for speed/bandwidth).
2. Some way to specify an override on .gitmodules sources.  This is
because our .gitmodules includes public, read-only sources (github),
rather than our local repos we would prefer to deploy from (for the
purpose of reliability).

The other use-case for feature #2 is the read-only vs. writable repository sources. Developers that are also working on the submodules should be able to clone from separate repository sources. Though this could be (and perhaps is) satisfied with a pushurl= in .gitmodules, I'd like to keep the push url non-public, and that still would leave us unable to deploy from different urls.

For #2 maybe something like this:
$ git clone --recursive --depth 1 --modules foo.modules\
> git@example.com/foo.git
where foo.modules contains:
<begin>
[submodule "bar"]
	path = bar
	url = git@example.com/bar.git
[submodule "bar/baz"]
	path = bar/baz
	url = git@example.com/baz.git
<end>

Notice how the .gitmodules needs to be able to specify recursive sources as well. Presumably `git submodule init` would take --modules argument as well (and maybe git submodule update, too).

I'm not well-versed in the git source code yet, but poking around suggests that this is doable. Would a patch be well received (or does someone want to do it for me :-)

cheers, sky

Next: Avery Pennarun
Message 1 of 8 in “[RFC] submodule+shallow clone feature request”
  1. Schuyler DuveenFeb 10, 2010
  2. Avery PennarunFeb 10, 2010
  3. Junio C HamanoFeb 10, 2010
  4. Johannes SchindelinFeb 10, 2010
  5. Junio C HamanoFeb 10, 2010
  6. Johannes SchindelinFeb 10, 2010
  7. Re* [RFC] submodule+shallow clone feature requestJunio C Hamano, Feb 11, 2010
  8. Peter HuttererFeb 11, 2010

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.