From 4757ff4ab7b4dac560cad26db12e28ef741c96ff Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Fri, 30 Oct 2020 03:35:32 +0200
Subject: utils: hooks: pre-push: Reject commits with a Change-Id
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We're not using gerrit, so let's prevent Change-Id tags creeping in
unadvertently.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 utils/hooks/pre-push | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'utils/hooks')

diff --git a/utils/hooks/pre-push b/utils/hooks/pre-push
index 2417d379..d13e2c3b 100755
--- a/utils/hooks/pre-push
+++ b/utils/hooks/pre-push
@@ -63,6 +63,13 @@ do
 			echo >&2 "No Reviewed-by or Acked-by in commit $commit"
 			errors=$((errors+1))
 		fi
+
+		# 4. The commit message shall not contain a Change-Id.
+		if echo "$msg" | grep -q '^Change-Id:'
+		then
+			echo >&2 "Found Change-Id in commit $commit"
+			errors=$((errors+1))
+		fi
 	done
 
 	if [ $errors != 0 ]
-- 
cgit v1.2.1