From a48d81b9ad6bf9304bff4f73a53c850396986a59 Mon Sep 17 00:00:00 2001 From: liuhaitao Date: Tue, 7 Sep 2021 11:09:02 +0800 Subject: [PATCH] checkpatch.sh: add check gerrit Change-ID support Signed-off-by: liuhaitao --- tools/checkpatch.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh index 5ba15d817f..5e08b2abd7 100755 --- a/tools/checkpatch.sh +++ b/tools/checkpatch.sh @@ -90,7 +90,18 @@ check_patch() { fi } +check_msg() { + while read; do + if [[ $REPLY =~ ^Change-Id ]]; then + echo "Remove Gerrit Change-ID's before submitting upstream" + fail=1 + fi + done +} + check_commit() { + msg=`git show -s --format=%B $1` + check_msg <<< "$msg" diffs=`git diff $1` check_ranges <<< "$diffs" }