Ask HN: What's your opinion on testing and linting Git commit hooks? - jehlakj
======
qualsiasi
On all branches it seems to much to me, but maybe on master (or any release or
pre-release branch) you may want them.

At my current company we're on such an old and badly written codebase that
this kind of hook would just annoy 90% of people. In fact some years ago we
tried to introduce that and people escalated quickly to a manager and had that
removed.

~~~
jehlakj
I’m rather indifferent about it, but it seems to be one of those controversial
topics in programming. Could you elaborate why you wouldn’t want it on all
branches? That’s how most people do it if they do this sort of thing in the
first place. And have the build server kick off its own sequence.

~~~
qualsiasi
Somethimes you just use a few branches for testing feasibility - most of the
time at my current company this involves zero testing and poor code quality.
Moreover some developers (me included) are afraid of losing work and push
frequently even "broken" code just for the safety of it. I tend to see feature
branches as a "work in progress" and as such code quality could be temporarily
lower than expected. On merge request linting and testing should however be
good.

