git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Would it be possible to add an option to disable validating submodule paths?

From
VZVadim Zeitlin <vz-git@zeitlins.org>
Date
Jan 7, 2025, 22:00 UTC
Message-ID
<Mahogany-0.68.0-2854301-20250107-230058.01@dark.tt-solutions.com>
 Hello,
 In e8d0608944 (submodule: require the submodule path to contain
directories only, 2024-03-26) a check that submodule paths don't contain
symlinks was added to Git. I understand that this check is generally useful
and helpful, but I'd really like to have some way of disabling it for some
trusted repositories and _allow_ some of their submodules to be symlinks
(see below for the rationale).
 Unfortunately, there doesn't seem to be any way to do it currently and I'd
like to ask if I might, perhaps, be missing such a way or, if I don't,
whether a patch adding an option to do it could be accepted?
 As to why I'd like to disable it, it's the usual story: this change broke
my workflow (https://xkcd.com/1172/). I have a relatively big Git
repository that I use as a submodule in many of the projects I'm working on
and I used to just symlink the corresponding submodule directory to one,
primary copy of this repository present on my system, instead of really
initializing the submodule. This saved me many gigabytes of disk space and
is also much faster than reinitializing the submodule every time I start a
new project or, more frequently, create a new worktree for the existing
one. And this worked just fine for many years but doesn't work any longer
as any operation on the repository, even just "git status", now gives
error: expected submodule path 'submodule/path' not to be a symbolic link

as soon as a symlink is detected. Under Linux I can use mount binds instead, but this is much less convenient for many reasons and I'd really prefer to just keep using symlinks. Would it be possible to (optionally) allow using them again?

 Thanks in advance,
VZ
Next: brian m. carlson
Message 1 of 7 in “Would it be possible to add an option to disable validating submodule paths?”
  1. Vadim ZeitlinJan 7, 2025
  2. brian m. carlsonJan 7, 2025
  3. Junio C HamanoJan 7, 2025
  4. Re[2]: Would it be possible to add an option to disable validating submodule paths?Vadim Zeitlin, Jan 7, 2025
  5. Junio C HamanoJan 8, 2025
  6. Re[2]: Would it be possible to add an option to disable validating submodule paths?Vadim Zeitlin, Jan 8, 2025
  7. submodule: Add a config option to skip path validationVadim Zeitlin, Jul 28, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.