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

Re: [PATCH 5/5] Teach checkout to recursively checkout submodules

From
Jens Lehmann <jens.lehmann@web.de>
Date
Dec 27, 2013, 14:14 UTC
Message-ID
<52BD8B42.2060507@web.de>
In-Reply-To
<20131226162238.GQ20443@google.com>
Am 26.12.2013 17:22, schrieb Jonathan Nieder:
Show 27 quoted lines
> From: Jens Lehmann <Jens.Lehmann@web.de>
> Date: Wed, 13 Jun 2012 18:50:10 +0200
> 
> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> ---
> This is the patch that actually introduces the --recurse-submodules
> option, which makes the rest work.
> 
> The tests indicate some future directions for improving this, but
> it works reasonably well already.  I think I'd be most comfortable
> applying these if they were rearranged a little to the following
> order:
> 
>  1. First, introducing the --recurse-submodules option, perhaps
>     with no actual effect, with tests that it is parsed correctly,
>     the default works, etc.
> 
>  2. Then, adding the desired behaviors one by one with corresponding
>     tests (handling submodule modifications, removals, additions).
> 
>  3. Finally, any needed tweaks on top.
> 
> That way, it is easy to play around with early patches without
> worrying about the later ones at first, and the patches are easy
> to review to confirm that they at least don't break anything in
> the --no-recurse-submodules case.
Makes tons of sense.

The only feature I'm aware of that is currently missing is to read the path <-> name mappings from the correct .gitmodules blob, which is needed to populate submodules that appear.

> That said, Debian experimental has these applied as is already,
> and there haven't been any complaints yet.
Great!

I'm also using this code at $dayjob successfully for quite some time now. Additionally I also enable unconditional recursive checkout by putting a "return 1" in the first line of the submodule_needs_update() function (Which is a hack to emulate "autoupdate=true" while at the same time pretending to already having added "--recurse-submodules=config" to all call sites in git porcelain scripts that call plumbing themselves). Only in a few corner cases submodules aren't properly updated, but we'll weed those out while implementing the tests. And we need lots of those to cover all important combinations ...

Previous: Jonathan NiederNext: Junio C Hamano
Message 9 of 11 in “git checkout --recurse-submodules”
  1. 0/5 git checkout --recurse-submodulesJonathan Nieder, Dec 26, 2013
  2. 1/5 submodule: prepare for recursive checkout of submodulesJonathan Nieder, Dec 26, 2013
  3. Jens LehmannDec 27, 2013
  4. 2/5 submodule: teach unpack_trees() to remove submodule contentsJonathan Nieder, Dec 26, 2013
  5. Jens LehmannDec 27, 2013
  6. 3/5 submodule: teach unpack_trees() to repopulate submodulesJonathan Nieder, Dec 26, 2013
  7. 4/5 submodule: teach unpack_trees() to update submodulesJonathan Nieder, Dec 26, 2013
  8. 5/5 Teach checkout to recursively checkout submodulesJonathan Nieder, Dec 26, 2013
  9. Jens LehmannDec 27, 2013
  10. Junio C HamanoDec 26, 2013
  11. Jens LehmannDec 27, 2013

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.