Closed tammersaleh closed 4 years ago
Is the current use of core.hooksPath
a breaking change for you? If not, I'd rather not try to anticipate various other use patterns, but wait for those to emerge and then accommodate them.
I don't think caulking breaks per-repo git hooks. My understanding and some simple tests is that if you have a repo/.git/hooks/pre-commit
script, that will be executed instead of the one at core.hooksPath
. That's why check-repos.sh
does a simple check for gitleaks
in any per-repo pre-commit
script.
So, I don't think your "slightly dirty" solution is needed, as that's already the behavior.
Over to you...
@tammersaleh Let me know if I can close this, as I don't think it's the case that caulking
break per-repo git hooks. Thx.
I'm fairly confident it does, but I'm also not passionate about fixing it. Feel free to close.
Please re-open when you come across any situations that causes breakage for you. Thanks
The issue with the
core.hooksPath
setting is that it uses the global directory instead of the per-repository$GIT_DIR/hooks
directory:This breaks a number of plugins like git-crypt (and maybe git-LFS) and doesn't allow for pre-commit linters, etc. Even if we don't use any of those capabilities now, it feels like a recipe for confusion in the future. I can think of two solutions:
Add this snippet to the existing
~/.git-support/hooks/pre-commit
script:This is a simple (and only slightly dirty) solution.
Thoughts?