News for hackers. Stuff that matters.
Re:Discussion of the Benefits and Drawbacks of the Git Pre-C... by indentit on Monday October 20, 2025 @03:20AM (#45640824)
The solution could be a pre-push hook. I am also not a fan of pre-commit hooks because I just want to commit my wip changes. Not stash. Commit.

It's fine if the auto formatting tool hasn't been run. If the pre-commit hook changes my files silently, that is a big no-no for me.

I have had tools break things before and it makes it very hard to work out what happened.

Having it fail to push means I get to choose how to fix up my commits - whether I want a new one for formatting changes etc or to go back and edit a commit for a cleaner public history.

Re:Discussion of the Benefits and Drawbacks of the Git Pre-C... by rkomorn on Monday October 20, 2025 @03:49AM (#45640972)
I used to think pre-push was better than pre-commit but at some point I realized I was actually just kicking the can down the road and leaving bigger problems for myself. It's not downsides-free, but it's the better compromise for me.

100% agree on hooks being readonly.

Username oddly relevant to context btw.