shithub: dav1d

Download patch

ref: 16ba83510c69271d4b635a3f5fd43b73dfd89d20
parent: 466b524bff228e0096c2a835d3c2abfbf92b825c
author: Martin Storsjö <martin@martin.st>
date: Wed Feb 20 17:21:01 EST 2019

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).

--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,7 +11,19 @@
         - amd64
     script:
         - git grep -n -e $'\t' --or -e $'\r' -- . ':(exclude)*/compat/*' && exit 1
-        - /bin/true
+        - git remote add upstream https://code.videolan.org/videolan/dav1d.git && 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;
+              fi;
+              if echo "$msg" | head -1 | grep -q '\.$'; then
+                  echo "Malformed commit message in $i, trailing period in subject line";
+                  exit 1;
+              fi;
+          done
 
 build-debian:
     image: registry.videolan.org:5000/dav1d-debian-unstable:20190215130514