checkpatch: accept several commits
If several commit IDs are passed to the script, process them in order.
This helps check several commits in a development branch, for instance:
./scripts/checkpatch.sh `git rev-list master..HEAD`
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
diff --git a/scripts/checkpatch.sh b/scripts/checkpatch.sh
index 94d8c4f..3d8f1a6 100755
--- a/scripts/checkpatch.sh
+++ b/scripts/checkpatch.sh
@@ -10,7 +10,7 @@
usage() {
SCR=$(basename "$0")
echo "Usage: $SCR [--working] Check working area"
- echo " $SCR <commit> Check specific commit"
+ echo " $SCR <commit>... Check specific commit(s)"
echo " $SCR --diff <commit1> <commit2> Check diff commit1...commit2"
echo " $SCR --cached Check staging area"
echo " $SCR --help This help"
@@ -35,8 +35,8 @@
usage
;;
*)
- echo "Checking commit: "
- checkpatch "$1"
+ echo "Checking commit(s):"
+ for c in $*; do checkpatch $c; done
;;
esac