Thread (83 messages) 83 messages, 2 authors, 2017-03-18

Re: [PATCH v4 09/10] submodule--helper init: set submodule.<name>.active

From: Brandon Williams <hidden>
Date: 2017-03-17 21:55:54

On 03/17, Stefan Beller wrote:
On Thu, Mar 16, 2017 at 3:29 PM, Brandon Williams [off-list ref] wrote:
quoted
When initializing a submodule set the submodule.<name>.active config to
true if the module hasn't already been configured to be active by some
other means (e.g. a pathspec set in submodule.active).

Signed-off-by: Brandon Williams <redacted>
---
 builtin/submodule--helper.c |  7 +++++++
 t/t7400-submodule-basic.sh  | 11 +++++++++++
 2 files changed, 18 insertions(+)
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index e95738b42..a574596cb 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -361,6 +361,13 @@ static void init_submodule(const char *path, const char *prefix, int quiet)
                die(_("No url found for submodule path '%s' in .gitmodules"),
                        displaypath);

+       /* Set active flag for the submodule being initialized */
+       if (!is_submodule_initialized(path)) {
+               strbuf_reset(&sb);
+               strbuf_addf(&sb, "submodule.%s.active", sub->name);
In case a reroll is needed, you could mark this location with

    /*
     * NEEDSWORK: in a multi-working-tree world we need to set
     * this per-worktree here.
     */
I'll add this here and where this happens in clone.

-- 
Brandon Williams
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help