I had a look at the change and left some comments. The current hook automatically prepends the branch name to any commit message. I suggest to extend this, so it checks if the commit message already starts with the correct string and doesn't add it in this case (so we don't end up with "[main] [main] message").
It would also be nice to add a prepare-commit-msg hook that adds the string if you call "git commit" without the "-m" option. This way it would show up in the editor and it would remove the uncertainty about who is responsible for adding it.
Finally, issue973 lists some checks we want to do about what parents a commit can have (e.g., a commit on main, has to have another commit on main as its first parent.), in particular, this is in msg9380 and msg9376. Could you also add hooks for this?
|