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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brandon Williams <bmwill@xxxxxxxxxx> writes:

> When initializing a submodule set the submodule.<name>.active config to
> true to indicate that the submodule is active.
>
> Signed-off-by: Brandon Williams <bmwill@xxxxxxxxxx>
> ---

Hmph.  When you do

	git clone --submodule-spec=lib/

and resulting repository says "submodule.active = lib/", you are
saying that you are interested in anything in "lib/", now or in the
future--that is the point of 08/10.

It is unclear what your desire would be for a submodule that was
bound to somewhere in "lib/" in the superproject when you cloned
when it later gets moved outside "lib/".  With changes up to 08/10,
that submodule will no longer be interesting, but with this 09/10,
when recursing clone will activate it upon the initial clone, the
submodule is explicitly marked as active by its name, so no matter
where it gets moved later, it will remain to be interesting.

I am not sure if that is a desired behaviour.

>  builtin/submodule--helper.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index a3acc9e4c..b669ed031 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);
> +		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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]