Hacker News new | ask | show | jobs
by eru 177 days ago
> This includes Git. Don't try to force any particular workflow, including mandatory or automatically-enabled hooks.

And with git, you can even make anything that happens on the dev machines mandatory.

Anything you want to be mandatory needs to go into your CI. Pre-commit and pre-push hooks are just there to lower CI churn, not to guarantee anything.

(With the exception of people accidentally pushing secrets. The CI is too late for that, and a pre-push hook is a good idea.)

3 comments

A good analogy is: git hooks are client-side validation; CI is server-side validation, aka the only validation you can trust.
> with git, you can even make anything that happens on the dev machines mandatory

s/can/can't?

You can an an enterprise environment when following SOPs are mandatory due to cybersecurity and infrastructure requirements.
Yes, indeed.
You can run git commit with a --no-verify flag to skip these hooks