Re: [PATCH v4 4/4] submodule: fix case-folding gitdir filesystem colisions
From: Adrian Ratiu <hidden>
Date: 2025-11-10 17:11:54
On Sat, 08 Nov 2025, Aaron Schrab [off-list ref] wrote:
At 17:05 +0200 07 Nov 2025, Adrian Ratiu [off-list ref] wrote:quoted
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