From cfe070efec56e977b2a906697662f0c65305cde9 Mon Sep 17 00:00:00 2001 From: Mischa Date: Fri, 24 Jul 2026 23:54:43 +0200 Subject: [PATCH] fix(make): worktree-rm no longer unregisters user/ for the main checkout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `submodule deinit` is needed before `worktree remove` (a populated user/ blocks it), but worktrees share .git/config — so deiniting inside the worktree stripped submodule.user.url globally. After any `make worktree-rm` the main checkout's `git submodule status` reported `-` (not initialised) while user/ sat there fully intact, and a later `submodule update` would have had no URL to work from. Re-register with an idempotent `submodule init` after the removal. Found by tearing down the post-location-override worktree. Co-Authored-By: Claude Opus 5 --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 6153a22..0b51158 100644 --- a/Makefile +++ b/Makefile @@ -200,6 +200,12 @@ worktree-rm: guard-name -git -C "$(WT_DIR)" submodule deinit -f user git worktree remove --force "$(WT_DIR)" git worktree prune + # The deinit above is required (a populated user/ blocks `worktree remove`), + # but worktrees SHARE .git/config — so it also strips submodule.user.url for + # the MAIN checkout, leaving `git submodule status` there showing `-` (not + # initialised) even though user/ is intact. Re-register it; init is + # idempotent and touches config only, never the working tree. + git submodule init @echo "Removed $(WT_DIR). If feat/$(NAME) is merged, drop it: git branch -d feat/$(NAME)" # ── Demo content ──────────────────────────────────────────────────────────────