From: Cristina Pauna Date: Thu, 25 Apr 2019 13:03:40 +0000 (+0300) Subject: Add verify for signed patch X-Git-Tag: 2.0.0~94^2 X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=validation.git;a=commitdiff_plain;h=d155e193f557cc270971bdb42208c2ffb3100845 Add verify for signed patch JIRA: VAL-12 Add a script to verify that each patch has a "Signed-off-by" line Run the script with tox, so that the check is made for each patch submitted in gerrit Change-Id: I078d032fc1ebf79b710fd93689de47f298e0adce Signed-off-by: Cristina Pauna --- diff --git a/tox.ini b/tox.ini index f53943c..c6ac867 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,17 @@ [tox] minversion = 1.6 envlist = + signedCommit, coala, skipsdist = true passenv = TOX_WORK_DIR toxworkdir = {env:TOX_WORK_DIR:/tmp/v} +[testenv:signedCommit] +whitelist_externals = bash +commands = + bash utils/signed.sh + [testenv:coala] basepython = python3 deps = diff --git a/utils/signed.sh b/utils/signed.sh new file mode 100755 index 0000000..d5e4e04 --- /dev/null +++ b/utils/signed.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Check that the last commit message contains the "Signed-off-by <>" line + +signature="$(git log -1 --show-signature |grep Signed-off-by:)" + +if [ -z "$signature" ]; then + echo "Signed-off-by is missing from the commit message; please run \"git commit -s --amend\"" + exit 1 +fi