Development record
The rename remedy abcd prints and documents, mv ~/.abcd ~/.abcd.noindex && for w in ~/.abcd.noindex/worktrees/*/*; do git -C "$w" worktree repair; done, assumes every worktree sits exactly two levels down, at worktrees/<root-sha>/<name>. A worktree named after its branch, such as docs/capture-sibling-repo-owner-redaction, sits three levels down, so the loop runs git in the docs/ folder above it, fails with 'not a git repository', and never repairs it. One left over at one level, with no root-sha key, gets git run on each of its files ('cannot change to …/AGENTS.md: Not a directory'). Seen on 2026-10-05 in a second account on this machine: eleven 'not a git repository' lines and five 'Not a directory' lines, and afterwards worktrees/488a0aa9…/docs/capture-sibling-repo-owner-redaction still had its main checkout pointing back at the old ~/.abcd path, so git treats it as missing and a git worktree prune would drop its entry. The 'repair: gitdir incorrect' lines in the same output are successful repairs that read like errors. The store there also held empty branch-prefix folders left by removed worktrees (check/, chore/, fix/ …) and a 117 KB test log at its top level.
The rename remedy abcd prints and documents, mv ~/.abcd ~/.abcd.noindex && for w in ~/.abcd.noindex/worktrees//; do git -C "$w" worktree repair; done, assumes every worktree sits exactly two levels down, at worktrees/<root-sha>/<name>. A worktree named after its branch, such as docs/capture-sibling-repo-owner-redaction, sits three levels down, so the loop runs git in the docs/ folder above it, fails with 'not a git repository', and never repairs it. One left over at one level, with no root-sha key, gets git run on each of its files ('cannot change to …/AGENTS.md: Not a directory'). Seen on 2026-10-05 in a second account on this machine: eleven 'not a git repository' lines and five 'Not a directory' lines, and afterwards worktrees/488a0aa9…/docs/capture-sibling-repo-owner-redaction still had its main checkout pointing back at the old ~/.abcd path, so git treats it as missing and a git worktree prune would drop its entry. The 'repair: gitdir incorrect' lines in the same output are successful repairs that read like errors. The store there also held empty branch-prefix folders left by removed worktrees (check/, chore/, fix/ …) and a 117 KB test log at its top level.
Grounds
- pursued: a person who renames the folder and runs the printed repair finds every store worktree, at any depth, linked back from its repository, and abcd ahoy reports none unlinked; a worktree still listed prunable after the repair, or one ahoy fails to name, would show it wrong
Frontmatter
| id | iss-2610050728100598 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | major |
.abcd/work/issues/resolved/iss-2610050728100598-the-rename-repair-loop-misses-worktrees.md
open on GitHub ↗ · commit history ↗