Repository navigation
feat(TASK-22): default install-hooks.sh to core.hooksPath mode - #28
Merged
Merged
Conversation
added 2 commits
October 9, 2026 15:06
.git/hooks/ is not tracked by git, so the tracked hooks in .githooks/ had to be copied in by hand on every fresh clone. On x270 the copy step had never run: .git/hooks/ was empty, core.hooksPath was unset, and commits went through with no validation and no gitleaks scan at all. Pointing core.hooksPath at .githooks/ removes the copy entirely, so the hooks cannot go stale against a working-tree edit either. That becomes the default; --copy stays available for setups that cannot set core.hooksPath (older git, shared .git directory). Also, hooks-path mode now reports stale marked copies in .git/hooks/, since hooksPath wins over them and their presence is otherwise confusing. README and AGENTS.md updated to match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
.git/hooks/is not tracked by git, so the tracked hooks in.githooks/had to be copied in by hand after every fresh clone.On this clone the copy step had never actually run:
So commits went through with no
tools/validate.sh --hookand no gitleaks scan.README.mddocumented the copy step, but nothing enforced it — which is what TASK-22 called out.Fix
tools/install-hooks.shnow defaults tocore.hooksPath=.githooks:--copyremains available for setups that cannot setcore.hooksPath(older git, shared.gitdirectory).--hooks-pathkept as an explicit no-op alias, so existing invocations keep working.--uninstallunchanged: unsets the config and still only deletes copies carrying themanaged-bymarker.hooks-pathmode also reports stale marked copies left in.git/hooks/.core.hooksPathwins over them, so they are inert, but their presence is confusing otherwise.Docs updated:
README.md(tree, quick-commands block, Secret scanning section) andAGENTS.md.Verification
tools/validate.shpasses. Both commits ran through the newly-activated hook, which is the fix confirming itself.shellcheckreports SKIP on this host (not installed); CI covers it.Note for reviewers
Editing
tools/install-hooks.shdropped its exec bit in the worktree, andcore.fileMode=falsemeant git did not notice.chmod +xwas applied before committing. Worth a look at whethercore.fileModeshould betrueon Linux hosts — it currently hides mode drift everywhere.