git-hooks: check for signed-off-by in the commit-msg hook

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic85bb838dfb236b7f1a244fd79f8ebeee0453a80
pull/510/head
Miklos Vajna 2020-11-04 08:39:19 +01:00
parent e9652b99b2
commit db10f7f81e
1 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,12 @@ if test ! -f "$1" ; then
exit 1
fi
if ! grep -q "^Signed-off-by:" "$1"; then
echo "Commit message is not signed off: $1"
echo "Use 'git commit -s' to sign off the commit message."
exit 1
fi
# Do not create a change id if requested
if test "false" = "`git config --bool --get gerrit.createChangeId`" ; then
exit 0