From: Miguel Angel Ajo <[email protected]>

This utility script exports the on the tail of your current branch,
and runs utilities/checkpatch.py on each of them.

Signed-off-by: Miguel Angel Ajo <[email protected]>
---
 utilities/git-checkpatches | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100755 utilities/git-checkpatches

diff --git a/utilities/git-checkpatches b/utilities/git-checkpatches
new file mode 100755
index 0000000..d25f41f
--- /dev/null
+++ b/utilities/git-checkpatches
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# usage: git-checkpatches [number of patches]
+#
+# this script can be used to pass checkpatch on a set of patches
+# of your git history
+#
+
+# just one patch by default
+PATCHES=${1:-1}
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+TMPDIR=$(mktemp -d)
+
+git_span="HEAD~$PATCHES..HEAD"
+
+echo "Checking patches $git_span"
+
+git format-patch -n $git_span -o $TMPDIR
+for patch in $TMPDIR/*.patch; do
+    echo "Checking patch $patch ========================"
+    $DIR/checkpatch.py $patch
+    echo ""
+done
+
+rm -rf $TMPDIR
-- 
1.8.3.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to