On Thu, Feb 23, 2017 at 3:47 PM, Brandon Williams <bmwill@xxxxxxxxxx> wrote: > There are two motivations for decoupling a submodule's existence from the url > that is stored in .git/config. > > 1. Worktrees can't really be used with submodules since the existence is > checked based on the shared .git/config. This means that two different > worktress have to have the same initialized submodules. By decoupling a > submodule's existence from the url, two different work trees can be > configured to have different submodules checked out. cc Duy for this one: Well once we have the per-worktree configuration, e.g. [1] we can *technically* have different submodules in different worktrees by saying workingtree0: submodule.<name>.url = git://example.org/real-submodule workingtree1: submodule.<name>.url = bogus workingtree2: submodule.<name>.url = more bogus and once we used the URL in the first workingtree all urls are degraded to a boolean flag, so the different (possible bogus) content does not do harm, only user-confusion, because the model of the URL being the flag indicating existence doesn't quite fit multiple working trees. [1] https://public-inbox.org/git/20170110112524.12870-3-pclouds@xxxxxxxxx/ > 2. Easily configure gorups of submodules that a user is interested in. In a > repository with hundreds of submodules it would be difficult to easily tell git > which modules to worry about without having to individually init all of > them. Instead, a pathspec can be used to more easily select or deselect > groups of submodules. > > This patch series works to do this decoupling and instead allows a user to > configure submodule.active with a pathspec to use to check if a submodule is > initialized. Thanks for stating both intentions! Stefan