Commit 16ba8351 authored by Martin Storsjö's avatar Martin Storsjö Committed by Jean-Baptiste Kempf
Browse files

ci: Check the style of commit messages

Check all commits, not just the latest one, as a branch may consist
of multiple commits. Exclude commits from upstream master (which
may contain issues which we want to error out for on new commits).
parent 466b524b
Pipeline #4890 passed with stages
in 6 minutes and 38 seconds
......@@ -11,7 +11,19 @@ style-check:
- amd64
- git grep -n -e $'\t' --or -e $'\r' -- . ':(exclude)*/compat/*' && exit 1
- /bin/true
- git remote add upstream && git fetch -q upstream master
- for i in $(git rev-list HEAD ^upstream/master); do
echo "Checking commit message of $i";
msg="$(git log --format=%B -n 1 $i)";
if [ -n "$(echo "$msg" | awk "NR==2")" ]; then
echo "Malformed commit message in $i, second line must be empty";
exit 1;
if echo "$msg" | head -1 | grep -q '\.$'; then
echo "Malformed commit message in $i, trailing period in subject line";
exit 1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment