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

Re: [1.8.0] Recursively checkout, merge and reset populated submodules

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Feb 21, 2011, 16:13 UTC
Message-ID
<4D628F21.3050808@xiplink.com>
In-Reply-To
<4D5FF6E7.8090104@web.de>
On 11-02-19 11:59 AM, Jens Lehmann wrote:
Show 18 quoted lines
> Proposal:
> When switching branches, merging or resetting the work tree of
> populated submodules should be checked out too according to the
> commit recorded in the superproject. Make this the default for
> porcelain and optional for plumbing.
> 
> The same safety precautions that are used for files in the
> superproject apply to the changes present in the submodules,
> no local modifications may be overwritten unless -f is used.
> When the "update" config option is set to "merge" or "rebase"
> the submodule will be left unchanged.
> 
> The "update" config option will learn a new value "none" to let
> the user turn off this behavior for single submodules. A global
> config option and the command line parameter "--recurse-submodules"
> will also be added. This change will remove the need to call "git
> submodule update" for all populated submodules (except those who
> use the "update=merge" or "update=rebase" configuration settings).
A big +1 from me for all the submodule work -- thanks Jens!

Could you clarify the proposal a bit? A few questions occurred to me as I read it:

* How is the initial set of populated submodules set up during a clone
operation?  Specifically, how would the origin repo specify which submodules
to recursively clone?  (My understanding is that the origin's .gitmodules
file, as it exists in whatever branch is being cloned, would specify
submodule.<name>.update values, and those would drive the recursion.)
* Which values of submodule.<name>.update would enable/disable recursion
during a clone?  Would just "checkout" enable it, or should "merge" and
"rebase" also trigger recursion when cloning?
* What happens when a clone's user manually populates one of the other
submodules that wasn't part of the initial set?  Automatic recursion into
this newly-populated submodule is controlled by the setting of the global
recurse-submodules option, right?
* What are the possible values of the global recurse-submodules option?
Here's what I came up with:
  all       -- Always recurse
  populated -- Only recurse into *all* currently-populated submodules
  respect   -- Respect each submodule's "update" option (better name?)
  none      -- Never recurse
* What will happen when I start checked out at commit A, with a populated
submodule, then check out commit B where that submodule doesn't exist, then
return to commit A?  How will whatever recursion settings I had at the start
be preserved?
		M.
Previous: Junio C HamanoNext: Jens Lehmann
Message 8 of 14 in “[1.8.0] Summary of the discussions”
  1. Junio C HamanoFeb 18, 2011
  2. Martin von ZweigbergkFeb 18, 2011
  3. [1.7.5] Let fetch and pull recurse into submodules when new commits are recordedJens Lehmann, Feb 19, 2011
  4. Marc BranchaudFeb 21, 2011
  5. Jens LehmannFeb 21, 2011
  6. [1.8.0] Recursively checkout, merge and reset populated submodulesJens Lehmann, Feb 19, 2011
  7. Junio C HamanoFeb 20, 2011
  8. Marc BranchaudFeb 21, 2011
  9. Jens LehmannFeb 21, 2011
  10. Marc BranchaudFeb 21, 2011
  11. Jens LehmannFeb 21, 2011
  12. Miles BaderFeb 22, 2011
  13. Phil HordFeb 22, 2011
  14. Jens LehmannFeb 22, 2011

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.