2 ms·
> 4. Pre-commit hooks are an anti-pattern. The repo creator has no business messing with my local, half-broken experiment/exploration commits. Do that on push i
by account42 3y ago
> 4. Pre-commit hooks are an anti-pattern. The repo creator has no business messing with my local, half-broken experiment/exploration commits. Do that on push if you must.
Git hooks are not part of the version controlled repository so you can already set them to whatever you like (for anything executed local anyway, push hooks are up to the remote).
You can also bypass them using --no-verify for cases where you consider that to be the right thing to do.
- persnickety 3y agoWeird, I never once set them myself but I've been subjected to them a couple times. Is my laptop developing gremlins?
- GrumpySloth 3y agoSomeone might have given you a command to run when setting up a repo. For example, it’s standard practice to download a hook which assigns a Change-Id to each commit when using Gerrit.