Re: [PATCH] push: change submodule default to check
- From
Stefan Beller <sbeller@google.com>
- Date
- Oct 4, 2016, 18:05 UTC
- Message-ID
- <CAGZ79kb=q9vCMxKTCfuGGDZdHMdAmh5RP0KN=vCbSS=oerPH3Q@mail.gmail.com>
- In-Reply-To
- <xmqqfuocuh92.fsf@gitster.mtv.corp.google.com>
On Tue, Oct 4, 2016 at 11:00 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> +static void preset_submodule_default(void)
>> +{
>> + if (file_exists(".gitmodules"))
>
> Don't we need to see if we are in a bare repository?See discussion with Jeff; instead of checking the file, we rather want to check if $GIT_DIR/modules/ is populated, as that is version agnostic ("Was a submodule initialized and fetched at any time in the life time of this repository?"), as well as bare/non-bare agnostic.
Show 6 quoted lines
> >> + recurse_submodules = RECURSE_SUBMODULES_CHECK; >> + else >> + recurse_submodules = RECURSE_SUBMODULES_DEFAULT; > > Hmph, why "_DEFAULT" not "_OFF"?
You answered yourself below, and that was indeed my thought. I was also wondering whether to remove the else, but then I thought that we'd rather do not want to rely on compiled-in at all, and have one init function which sets out the new world order.