Re: [PATCH v2] clone: use submodules.recurse option for automatically clone submodules
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 7, 2020, 18:17 UTC
- Message-ID
- <xmqqeev645zy.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.2002071621160.3718@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 12 quoted lines
>> if (!strcmp(var, "submodule.recurse")) {
>> if (git_config_bool(var, value))
>> ...
>> return 0; /* done with the variable either way */
>> }
>>
>> is more appropriate.
>
> Good catch, and I think you will have to do even more: in the "else" case,
> it is possible that the user overrode a `submodule.recurse` from the
> system config in their user-wide config, so we must _undo_ the
> `string_list_append().Yeah, I tend to agree that submodule.recurse should not be made into a multi-valued fields with this change; it should stay to be the usual last-one-wins single boolean.
> Further, it is probably not a good idea to append "true" _twice_ if > multiple configs in the chain specify `submodule.recurse = true`.
The user of this list in cmd_clone() first sorts and dedups, so appending the same is OK, even though it may appear sloppy.