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. 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. Brandon Williams (10): submodule: decouple url and submodule existence submodule update: add `--init-active` switch clone: add --submodule-spec=<pathspec> switch completion: clone can initialize specific submodules submodule--helper: add is_active command submodule add: respect submodule.active submodule status: use submodule--helper is-active submodule deinit: use most reliable url submodule sync: use submodule--helper is-active submodule--helper clone: check for configured submodules using helper Documentation/git-clone.txt | 23 ++++--- Documentation/git-submodule.txt | 11 +++- builtin/clone.c | 36 ++++++++++- builtin/submodule--helper.c | 22 ++++--- contrib/completion/git-completion.bash | 1 + git-submodule.sh | 39 +++++++++--- submodule.c | 25 +++++++- t/t7400-submodule-basic.sh | 109 +++++++++++++++++++++++++++++++++ t/t7413-submodule-is-active.sh | 85 +++++++++++++++++++++++++ 9 files changed, 323 insertions(+), 28 deletions(-) create mode 100755 t/t7413-submodule-is-active.sh -- 2.11.0.483.g087da7b7c-goog