2016-06-04 05:22:01 +08:00
|
|
|
#! /bin/bash -e
|
|
|
|
#
|
|
|
|
# @testcase static defaults=none
|
|
|
|
# @eval shcmd %(thisfile)s %(srcdir)s/../../
|
|
|
|
# @tags bat
|
|
|
|
#
|
|
|
|
# If checkpatch.pl is not on your path, you can:
|
|
|
|
# 1 - put it in your path (copy or symlink)
|
|
|
|
# 2 - export CPPPATH to the path where it is
|
|
|
|
#
|
|
|
|
# (1) is easier
|
|
|
|
#
|
|
|
|
set -eu -o pipefail
|
|
|
|
cd $1 || exit 127
|
|
|
|
# If no modifications to the tree, check the previous commit;
|
|
|
|
# otherwise, show the current modifications
|
|
|
|
if git diff-index HEAD --quiet; then
|
2016-11-05 08:45:15 +08:00
|
|
|
git show --format=email HEAD || exit 127
|
2016-06-04 05:22:01 +08:00
|
|
|
else
|
|
|
|
git diff HEAD || exit 127
|
|
|
|
fi \
|
|
|
|
| ${CPPATH:-scripts/}checkpatch.pl \
|
|
|
|
${CPOPTS:---no-tree --patch --show-types --mailback --terse --showfile --ignore FILE_PATH_CHANGES } \
|
|
|
|
-
|