diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh index 5e08b2abd70..abd71071f91 100755 --- a/tools/checkpatch.sh +++ b/tools/checkpatch.sh @@ -23,6 +23,7 @@ check=check_patch fail=0 range=0 spell=0 +message=0 usage() { echo "USAGE: ${0} [options] [list|-]" @@ -32,6 +33,7 @@ usage() { echo "-c spell check with codespell(install with: pip install codespell)" echo "-r range check only (coupled with -p or -g)" echo "-p (default)" + echo "-m Change-Id check in commit message (coupled with -g)" echo "-g " echo "-f " echo "- read standard input mainly used by git pre-commit hook as below:" @@ -100,8 +102,10 @@ check_msg() { } check_commit() { - msg=`git show -s --format=%B $1` - check_msg <<< "$msg" + if [ $message != 0 ]; then + msg=`git show -s --format=%B $1` + check_msg <<< "$msg" + fi diffs=`git diff $1` check_ranges <<< "$diffs" } @@ -124,6 +128,9 @@ while [ ! -z "$1" ]; do -f ) check=check_file ;; + -m ) + message=1 + ;; -g ) check=check_commit ;;