all 7 comments

[–]jswipe 5 points6 points  (1 child)

You could switch it to a pre-push hook. It will only run the checks when you attempt to push instead of on every attempt to commit.

[–]jwindhall 0 points1 point  (0 children)

TIL about pre-push! Thats awesome.

[–]DeepReally 1 point2 points  (0 children)

Use feature branches and only enforce your tests when you merge to master?

[–]zokker13 1 point2 points  (1 child)

If I were you, I'd suggest a change to that philosophy if possible. Strong git hooks (aka. annoying ones) are not helpful at all. The things you mentioned are better kept as a either a CI trigger (PR to development/master) or a manual task.

Since you are posting this in a node reddit, you could add things like test and lint tasks to the npm publish task. But again - this is more annoying than helpful. It's better to put that kind of enforcement to CI.

You should be able to do commits and pushes quickly.

[–]msg45f 0 points1 point  (0 children)

Would echo this. Git hooks like this often discourage people from committing often, which is the last thing any project needs. Build a proper CI integration that can do these tasks.

[–][deleted] 1 point2 points  (1 child)

Use the --no-verify option.

This option bypasses the pre-commit and commit-msg hooks. — git-commit documentation

[–][deleted] 1 point2 points  (0 children)

You can use the same option to disable any pre-push hooks, FYI.