• 7 Posts
  • 11 Comments
Joined 6 months ago
cake
Cake day: July 14th, 2025

help-circle
  • Everytine I’ve seen a pre-commit hook in my job, it was something that should have been in integration pipeline.

    You should not run linter, test or any static analysis tool in a pre-commit (I’m looking at you husky 😡). Why ? Because:

    • It takes time. A commit should be instantaneous.

    • It may change the content of the commit or of the repos without explicite action of the developer.

    • The developper’s branch is the developper’s mess. He don’t have to respect any convention, any quality gate or any workflow on its branch. Quality gates should happen only when integrating into trunk.

    I always commit and push on Friday afternoon before leaving as “WIP”, in case my computer crash during week end. I don’t want to address issues of a WIP job. I just want to backup my work.

    I may commit several time per minute, and do a rebase latter. I don’t want to spend 2min each time waiting for eslint to parse the repos. I don’t want to fix styling because I now I will fix it later and rebase -i before pushing.

    You can use custom pre-commit in your own workflow, but forcing all developer to have the same pre-commit is a bad idea.





  • I gave a try to jj. It’s fine for personal projects or small team and make the workflow a bit easier. No more “git add; git commit; git push” each time you do a modification. You just “jj git push” and everything will be automatically pushed.

    However, the biggest criticism I have is that he doesn’t encourage to push every time. It really encourages you to keep your modif locally and push only to create a PR, and that’s not a good approach.

    Even if you code is WIP, even if everything crash, you really should push your code to backup it. Who cares ? As long as it is not on master branch, it’s your own mess.