Subject: Re: [PATCH] doc: remove mentions of .gitmodules !command syntax

From: Junio C Hamano <[email-masked]>
Date: Wed, 12 Jul 2023 13:33:55 -0700

Petar Vutov <[email-masked]> writes:

> On 7/12/23 19:54, Junio C Hamano wrote:
>> Perhaps
>>      "... available via the ... configuration variable, and cannot
>> be
>>      used in the .gitmodules file"
>> would have helped you?
>> Thanks.
>
> I think that addition is good and makes the intent clearer.
>
> But it's slightly wrong - only 'custom command' cannot be used in
> .gitmodules. 'none' is legal (and mentioned in the gitmodules doc as
> such).

Hmph, that will be a bugfix for fc01a5d2 (submodule update
documentation: don't repeat ourselves, 2016-12-27).  I think you are
technically correct.

    Side note: but is there a useful use case to set it to 'none' in
    ".gitmodules" in the first place?  If there is not, saying that
    "'none' is only useful in the configuration files" is not quite
    wrong per-se.

>  	merge;; the commit recorded in the superproject will be merged
>  	    into the current branch in the submodule.
>
> -The following 'update' procedures are only available via the
> -`submodule.<name>.update` configuration variable:
> -
>  	custom command;; arbitrary shell command that takes a single
>  	    argument (the sha1 of the commit recorded in the
>  	    superproject) is executed. When `submodule.<name>.update`
>  	    is set to '!command', the remainder after the exclamation mark
>  	    is the custom command.
> ++
> +Custom commands are only available via the `submodule.<name>.update`
> +configuration variable. They cannot be used in the .gitmodules file.

Sounds good.  s/available/allowed/, perhaps.

>  	none;; the submodule is not updated.
> ++
> +The `none` update procedure is only available via the .gitmodules file
> +or the `submodule.<name>.update` configuration variable.

This side we do not need "only" anywhere in the sentence, do we?

Thanks.