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

[1.8.0] Recursively checkout, merge and reset populated submodules

From
Jens Lehmann <jens.lehmann@web.de>
Date
Feb 19, 2011, 16:59 UTC
Message-ID
<4D5FF6E7.8090104@web.de>
In-Reply-To
<7vwrky5f48.fsf@alter.siamese.dyndns.org>

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).

Advantages:
* This makes submodules behave like the files in the superproject.
  Every time the work tree of the superproject changes, the work
  trees of the populated submodules are updated accordingly.
* This is the least surprising behavior for new submodule users.

Risks: The commands might run longer, for those users who use submodules to gain performance by putting large and/or many files into submodules this may be unacceptable. Also people might be surprised by submodule work trees changing without explicitly invoking "git submodule update". These commands will now fail in the presence of changed submodules where they would have succeeded before.

Migration plan: Announce the change in behavior and document how to easily configure the old behavior when needed and enable this functionality in 1.8.0.

Previous: Jens LehmannNext: Junio C Hamano
Message 6 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.