Re: [PATCH v2 10/11] submodule--helper init: set submodule.<name>.active
- From
Stefan Beller <sbeller@google.com>
- Date
- Mar 9, 2017, 02:28 UTC
- Message-ID
- <CAGZ79kYspNw4=dSnDtyWp7bEhggAM-gRo3g9GJ78jZ8HW7pUFQ@mail.gmail.com>
- In-Reply-To
- <20170309012345.180702-11-bmwill@google.com>
On Wed, Mar 8, 2017 at 5:23 PM, Brandon Williams <bmwill@google.com> wrote:
> When initializing a submodule set the submodule.<name>.active config to > true to indicate that the submodule is active.
So by this patch an init of a submodule performs both a "regular init" (copy URL and the update setting) as well as setting the new submodule.<name>.active.
And both happens in the same config file (i.e. no worktree support here)
Later on we *could* remove the URL as the .active is the new flag of existence.
But enough of my speculation, I am left wondering what this patch accomplishes, as this states no agenda as why it is useful on its own.
Show 27 quoted lines
>
> Signed-off-by: Brandon Williams <bmwill@google.com>
> ---
> builtin/submodule--helper.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index bceb62a20..44f2c02ba 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -329,6 +329,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);
> + git_config_set_gently(sb.buf, "true");
> + }
> +
> /*
> * Copy url setting when it is not set yet.
> * To look up the url in .git/config, we must not fall back to
> --
> 2.12.0.246.ga2ecc84866-goog
>