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

[PATCH 0/3] submodule: support linked worktrees in recursive checkout

From
Adrian Ratiu <adrian.ratiu@collabora.com>
Date
Nov 18, 2026, 16:32 UTC
Message-ID
<20261118163249.1693361-1-adrian.ratiu@collabora.com>
In-Reply-To
<avuJBGlB3pRU3JU0@pampelmuse>
Hello all,

This fixes a few submodule bugs reported by Andreas at: https://lore.kernel.org/git/avuJBGlB3pRU3JU0@pampelmuse/

In short: when a submodule is a linked worktree of its repository ("git worktree add" inside the submodule), a recursive checkout in the superproject either crashes with a BUG() or leaves the submodule broken.

The patches should be self-explanatory, many thanks to Andreas for reporting and sharing a reproducer.

Regards, Adrian

Adrian Ratiu (3):
  submodule: return an error instead of BUG() for an unexpected git dir
  submodule: only suggest submodulePathConfig when it is disabled
  submodule: accept a linked worktree as the submodule's git dir
 submodule.c                                | 72 +++++++++++++++++++---
 t/t2405-worktree-submodule.sh              | 40 ++++++++++++
 t/t7425-submodule-gitdir-path-extension.sh | 14 +++++
 t/t7450-bad-git-dotfiles.sh                | 31 ++++++++++
 4 files changed, 148 insertions(+), 9 deletions(-)
base-commit: e1ec09b23c8e0deb21a0b95ac5996422277395d4
-- 
2.56.1
Previous: Adrian RatiuNext: Adrian Ratiu
Message 3 of 13 in “submodule: linked-worktree submodule hits BUG() in validate_submodule_legacy_git_dir()”
  1. Andreas WendlederNov 16, 2026
  2. Adrian RatiuNov 17, 2026
  3. 0/3 submodule: support linked worktrees in recursive checkoutAdrian Ratiu, Nov 18, 2026
  4. 1/3 submodule: return an error instead of BUG() for an unexpected git dirAdrian Ratiu, Nov 18, 2026
  5. Junio C HamanoNov 18, 2026
  6. Adrian RatiuNov 18, 2026
  7. 2/3 submodule: only suggest submodulePathConfig when it is disabledAdrian Ratiu, Nov 18, 2026
  8. Junio C HamanoNov 18, 2026
  9. Adrian RatiuNov 19, 2026
  10. Junio C HamanoNov 19, 2026
  11. 3/3 submodule: accept a linked worktree as the submodule's git dirAdrian Ratiu, Nov 18, 2026
  12. Junio C HamanoNov 18, 2026
  13. Adrian RatiuNov 19, 2026

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.