Subject: Re: [PATCH 3/9] submodule: add gitdir path config override

From: Adrian Ratiu <[email-masked]>
Date: Thu, 21 Aug 2025 15:18:00 +0300

On Wed, 20 Aug 2025, Josh Steadmon <[email-masked]> wrote:
> On 2025.08.17 00:36, Adrian Ratiu wrote: [snip] 
>> diff --git a/t/lib-verify-submodule-gitdir-path.sh 
>> b/t/lib-verify-submodule-gitdir-path.sh new file mode 100644 
>> index 0000000000..fb5cb8eea4 --- /dev/null +++ 
>> b/t/lib-verify-submodule-gitdir-path.sh @@ -0,0 +1,15 @@ +# 
>> Helper to verify if repo $1 contains a submodule named $2 with 
>> gitdir in path $3 
> 
> This comment is a bit inaccurate, right? If I'm reading 
> correctly, we only verify that the submodule's gitdir actually 
> exists in the "legacy" .git/modules/$path case. If we don't see 
> anything there, we fall through to 
> .git/submodules/$encoded_path, but we never verify it actually 
> exists. 
> 
 
It was not my intention to imply gitdir existence is verified 
here. :)

We just verify where the gitdirs are expected vs configured, 
regardless of existence (eg when adding a new submodule it won't 
exist beforehand).

The behavior you describe is correct: we only verify existence in 
the legacy case, yes, in submodule_name_to_gitdir(), because only 
those must exist beforehand and that's how we know we're in the 
legacy (backwards compatibility) case, otherwise we default to the 
newly encoded paths.

Hope this makes sense. I'll expand the description to clarify in v2.