4 Commits

Author SHA1 Message Date
Sven Klemm
5695e32858 Fix syntax error in commit hook 2019-04-09 13:45:20 +02:00
Sven Klemm
0823498b25 Stop processing commit message on scissors line
The commit message template may include the actual diff to be
committed separated with a special scissors line. This patch adds
support for the scissors line to the commit hook otherwise
the diff content may trigger any of the rules.
2019-04-09 11:07:30 +02:00
Erik Nordström
18a8afd1f8 Add a gitignore for Git hook tests
Running the git hook tests will leave some Python byte code files
lying around. This change hides those using a gitignore file.
2019-04-08 14:01:00 +02:00
Erik Nordström
881e3729c4 Add a Git commit hook to validate commit messages
Our coding guidelines recommend following "The seven rules of a great
Git commit message" by Chris Beams:

https://chris.beams.io/posts/git-commit/

This change adds a Git commit hook that validates all Git commit
messages according to these rules (at least to the extent possible).
Currently, the hook simply prints a warning and a list of violations
in case of a non-conforming Git commit message. The commit is
otherwise accepted. This could be changed to entirely fail the commit,
or, via another hook, fail to push any code that is non-conformant.

The hook will be installed on a CMake run or when the hook source
changes.
2019-04-08 10:38:41 +02:00