This makes it easier to use checkpatch with a git hook or via patches. Signed-off-by: Anthony Liguori <aligu...@us.ibm.com> --- scripts/check-patches.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 scripts/check-patches.sh
diff --git a/scripts/check-patches.sh b/scripts/check-patches.sh new file mode 100755 index 0000000..5a693fe --- /dev/null +++ b/scripts/check-patches.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# checkpatch helper - run checkpatch against each commit given a refspec +# +# Copyright IBM, Corp. 2013 +# +# Authors: +# Anthony Liguori <aligu...@us.ibm.com> +# +# This work is licensed under the terms of the GNU GPLv2 or later. +# See the COPYING file in the top-level directory. + +if test -z "$1"; then + echo "Usage: $0 REFSPEC" + exit 1 +fi + +git log --format="%H" "$@" | while read commit; do + git show --format=email $commit | scripts/checkpatch.pl - + rc=$? + if test $rc -ne 0; then + exit $rc + fi +done -- 1.8.0