[PATCH v2 00/10] Encode submodule gitdir names to avoid conflicts
- From
Adrian Ratiu <adrian.ratiu@collabora.com>
- Date
- Sep 8, 2025, 14:01 UTC
- Message-ID
- <20250908140117.262205-1-adrian.ratiu@collabora.com>
- In-Reply-To
- <20250816213642.3517822-1-adrian.ratiu@collabora.com>
Hello all,
This is v2 of the submodule encoding topic which fixes filesystem conflicts due to plain-text module name clashes (nested dirs, case insensitive FS).
This is based on the master branch and I've merged and ensured all CI passes with both next and seen branches, with all combinations (linux, win, osx, meson makefile, etc).
Changes between v1 -> v2: * Added test name prefixes to commits modifying tests (eg "t7454: modify ...") * Fixed all GitHub CI failures, including Win+Linux+Mac for both make and meson * Test branch names now use main, which also fixes linux-breaking-changes (Junio) * Replaced seq with test_seq for portability (Junio) * Moved submod_gitdir_path variable declaration inside if block (Josh) * Clarify FS existence check inside lib-verify-submodule-gitdir-path.sh (Josh) * Replaced (cd submod && git config) with test_config -C submod (Josh) * Document the new submodule--helper gitdir path option (Josh) * Replaced grep -> test_grep (Josh) * Reworded commit messages to use the proper commit reference format (Ben) * Removed claim this fixes the Windows reserved file names (Mark) * Split NAME_MAX logic into separate commit & added compat stub for pathconf (Peff)
Many thanks to all who have reviewed v1.
Adrian Ratiu (10): submodule--helper: use submodule_name_to_gitdir in add_submodule submodule: create new gitdirs under submodules path submodule: add gitdir path config override t7425: add basic mixed submodule gitdir path tests strbuf: bring back is_rfc3986_unreserved submodule: encode gitdir paths to avoid conflicts submodule: error out if gitdir name is too long submodule: remove validate_submodule_git_dir() t7450: move nested gitdir tests to t7425 t7425: add gitdir encoding tests
Documentation/config/submodule.adoc | 4 + Documentation/fetch-options.adoc | 2 +- Documentation/git-fetch.adoc | 2 +- Documentation/git-submodule.adoc | 2 +- Documentation/gitsubmodules.adoc | 8 +- Makefile | 5 + builtin/credential-store.c | 6 - builtin/submodule--helper.c | 51 +++--- compat/pathconf.c | 10 + compat/posix.h | 8 + config.mak.uname | 2 + meson.build | 1 + setup.c | 2 +- strbuf.c | 6 + strbuf.h | 2 + submodule.c | 162 ++++++++--------- submodule.h | 5 - t/lib-submodule-update.sh | 50 ++--- t/lib-verify-submodule-gitdir-path.sh | 20 ++ t/meson.build | 1 + t/t0035-safe-bare-repository.sh | 4 +- t/t1600-index.sh | 4 +- t/t2405-worktree-submodule.sh | 8 +- t/t2501-cwd-empty.sh | 2 +- t/t3600-rm.sh | 8 +- t/t5526-fetch-submodules.sh | 2 +- t/t5619-clone-local-ambiguous-transport.sh | 4 +- t/t6120-describe.sh | 4 +- t/t7001-mv.sh | 4 +- t/t7400-submodule-basic.sh | 27 ++- t/t7406-submodule-update.sh | 14 +- t/t7407-submodule-foreach.sh | 6 +- t/t7408-submodule-reference.sh | 22 +-- t/t7412-submodule-absorbgitdirs.sh | 22 +-- t/t7423-submodule-symlinks.sh | 8 +- t/t7425-submodule-mixed-gitdir-paths.sh | 202 +++++++++++++++++++++ t/t7450-bad-git-dotfiles.sh | 73 +------- t/t7527-builtin-fsmonitor.sh | 4 +- t/t9902-completion.sh | 1 + 39 files changed, 481 insertions(+), 287 deletions(-) create mode 100644 compat/pathconf.c create mode 100644 t/lib-verify-submodule-gitdir-path.sh create mode 100755 t/t7425-submodule-mixed-gitdir-paths.sh
-- 2.51.GIT