fix(install): resolve git hooks dir via git plumbing, fix stale plugin manifests #72
Reference in New Issue
Block a user
Delete Branch "fix/plugin-manifest-and-worktree-hooks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Unrelated pushes (the #68/#70 and #69/#71 fix branches from the same session) were failing
main's own pre-push hooks for reasons that had nothing to do with their changes:scripts/install.shhardcoded$REPO_ROOT/.git/hooks/, which breaks under any git worktree checkout —.gitthere is a file (a gitlink), not a directory. This blocks every worktree-based agent from installing hooks or pushing cleanly, which is exactly what surfaced this.plugins/bin/plugin.json,plugins/core/plugin.json,plugins/gitea/plugin.jsonreferenceagents/skillsdirectories that don't exist onmainyet, failingscripts/check-manifests.shfor any push, regardless of what's being changed. (gitea's real content already exists on the in-flightrefactor/6-gitea-deep-modulesbranch, pending merge — this PR just makesmaininternally consistent in the meantime;binandcoreare unrelated, standalone drift.)What changed
scripts/install.sh: resolve the git hooks directory viagit rev-parse --git-path hooks, unsetting inheritedGIT_DIR/GIT_WORK_TREEfirst (git sets these for hook child processes, which otherwise hijacks-C-based repo discovery) and normalizing to an absolute path (git returns it relative-to-queried-root for plain checkouts, absolute for worktrees).plugins/bin/plugin.json,plugins/core/plugin.json,plugins/gitea/plugin.json: dropagents/skillsfields pointing at directories that don't currently exist.tests/test-git-hooks-install.sh: added a regression case simulating the inherited-GIT_DIRhook scenario, and isolated the test's own fixture (git init) from ambientGIT_*env vars — the test previously silently re-targeted the real worktree gitdir instead of its temp fixture when run inside a hook, masking the bug it was meant to test.Verification
Full suite (
bash tests/run-tests.sh) andscripts/check-manifests.shpass, including under the exactGIT_DIR/GIT_EXEC_PATH/etc. environment captured from a realpre-pushhook invocation in a worktree.Not merging this myself — flagging for review since it touches shared install/hook infrastructure.