4 ms·
If a team of devs is incapable of writing good commits with simple prefixes then that's a strong case for adding git hooks that reject commits without the prefi
by lloydatkinson 2y ago
If a team of devs is incapable of writing good commits with simple prefixes then that's a strong case for adding git hooks that reject commits without the prefix.
Before someone starts getting their pants in a twist at this idea, you can configure a solution such that commits to branches don't need a conventional commit format, but that the commit that merges a PR into master must have conventional commit format.
- mihaaly 2y agoIn an idealized and simplistic (imaginary) world you are completely right, but here you missed the point quite a bit: People make mistakes! Everyone! Already. More things to watch for and take care of, with more people: more mistakes. Too much mistakes - that we already have without more aspects - negate the advantages of the idealized intended outcome. People working with other people in everyday situations could understand that.
- Izkata 2y agoForget mistakes, such a commit hook would prevent me from making small iterative commits. I'd just disable that hook within the first few days.
- lloydatkinson 2y ago> Before someone starts getting their pants in a twist at this idea, you can configure a solution such that commits to branches don't need a conventional commit format, but that the commit that merges a PR into master must have conventional commit format.
- shepherdjerred 2y agoYou can skip pre-commit hooks with the --no-verify flag https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---no-verify https://git-scm.com/docs/git-commit#Documentation/git-commit...
- keybored 2y ago> Before someone starts getting their pants in a twist at this idea, you can configure a solution such that commits to branches don't need a conventional commit format, but that the commit that merges a PR into master must have conventional commit format. Not can, must. You cannot enforce this for local development since git(1) doesn’t allow project-wide hooks for security reasons.
- lloydatkinson 2y agoI don't know where you're getting this but there are in fact many tools for local commit hooks https://typicode.github.io/husky/ https://typicode.github.io/husky/