From: Adrian Ratiu Date: Mon, 10 Nov 2025 17:11:29 GMT Subject: Re: [PATCH v4 4/4] submodule: fix case-folding gitdir filesystem colisions Message-ID: <87ecq5ke2m.fsf@gentoo.mail-host-address-is-not-set> In-Reply-To: <20251108T182050Z.vbNv4y2kizC1@fnord.qqx.org> On Sat, 08 Nov 2025, Aaron Schrab wrote: > At 17:05 +0200 07 Nov 2025, Adrian Ratiu > wrote: >>Add a new check in validate_submodule_git_dir() to detect and >>prevent case-folding filesystem colisions. When this new check >>is triggered, a stricter casefolding aware URI encoding is used >>to percent-encode uppercase characters, e.g. Foo becomes %46oo. >>By using this check/retry mechanism the uppercase encoding is >>only applied when necessary, so case-sensitive filesystems are >>not affected. > > What happens if `Foo` is added first and doesn't conflict with > anything, then later a new submodule is added which would > naturally get the name `foo` which would conflict and doesn't > have any upper case characters to encode to avoid the conflict? What an excellent question. Thank you! Right now, in v4, in this case the user adding the second `foo` module will have to manually set the submodule.foo.gitdir config to avoid the conflict, because Foo already uses the coliding path. I can add a test specifically for this edge case to exercise config overrides on case-folding file-systems conflicts. OR... Maybe we could derive a new path automatically (eg foo2 or foo_, suggestions welcome) and use it if valid. This way, there is no user intervention. Do you have any preference? Thanks again, Adrian