checkpatch.sh: add check gerrit Change-ID support

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This commit is contained in:
liuhaitao 2021-09-07 11:09:02 +08:00 committed by Xiang Xiao
parent c4216d062f
commit a48d81b9ad

View file

@ -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"
}