[libcamera-devel] [PATCH] utils: hooks: pre-push: Reject commits with a Change-Id

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Oct 30 02:37:35 CET 2020


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

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 utils/hooks/pre-push | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/utils/hooks/pre-push b/utils/hooks/pre-push
index 2417d379db4c..d13e2c3b506c 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 ]
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list