zlacker

[return to "Hk, a new Git hook manager"]
1. righth+K3[view] [source] 2025-02-17 16:43:57
>>DrBenC+(OP)
Git hooks are like make files for me. Copy/paste that `git staged files` command and then add your linter commands (in .githooks/pre-commit file). Add `set -e`. Set package manager post-install hook to config git to the `.githooks` dir.

Sadly I think git hook managers remove the simplicity of the whole design. Understandably since no one reads manuals anymore and projects don’t mind tacking on yet another module/plugin, however easy.

◧◩
2. cowsan+Fd[view] [source] 2025-02-17 17:36:18
>>righth+K3
The big difference with Makefiles is that git hooks can’t be committed to the repo. Hook managers allow hooks to be shared and updated across a team.
◧◩◪
3. globno+yp[view] [source] 2025-02-17 18:56:57
>>cowsan+Fd
So do dev-environment start-up scripts, which in my experience are always simpler, clearer, and more maintainable than these managers.

Just put your hook logic in a script and copy it to the git hooks folder on startup as necessary -- and then, voila, you've avoided the nonsense of some well-intentioned package whose author thinks Rust in git hooks is a selling point rather than a head scratcher.

[go to top]