3 CHECKPATCH="${CHECKPATCH:-checkpatch.pl}"
4 # checkpatch.pl will ignore the following paths
5 CHECKPATCH_IGNORE=$(echo core/lib/lib{fdt,tomcrypt} lib/lib{png,utils,zlib})
6 _CP_EXCL=$(for p in $CHECKPATCH_IGNORE; do echo ":(exclude)$p" ; done)
8 function _checkpatch() {
9 $CHECKPATCH --quiet --ignore FILE_PATH_CHANGES \
10 --ignore GERRIT_CHANGE_ID --no-tree -
13 function checkpatch() {
14 git show --oneline --no-patch $1
15 git format-patch -1 $1 --stdout -- $_CP_EXCL . | _checkpatch
18 function checkstaging() {
19 git diff --cached -- . $_CP_EXCL | _checkpatch
22 function checkworking() {
23 git diff -- . $_CP_EXCL | _checkpatch
26 function checkdiff() {
27 git diff $1...$2 -- . $_CP_EXCL | _checkpatch