tommarshall / git-good-commit

Git hook to help you write good commit messages, with no external dependencies.
MIT License
195 stars 33 forks source link

Add some magit integration #33

Open hanfried opened 5 years ago

hanfried commented 5 years ago

The non-interactive detection does not work when called from emacs magit. Also we'd like to force git-good-commit to commit a message, like when doing interactive.

So added logic to detect whether we are inside emacs and that looks in the comment section of the commit message if there is somewhere a

   # ggc: y

defined as comment and if, then it commits anyway. Otherwise it exits with an error message and also explaining what to do in case of forcing the commit.