aboutsummaryrefslogtreecommitdiff
path: root/scripts/ci-checkpatches.sh
diff options
context:
space:
mode:
authorBalakrishna Garapati <balakrishna.garapati@linaro.org>2017-07-26 11:22:25 +0200
committerBalakrishna Garapati <balakrishna.garapati@linaro.org>2017-07-26 11:22:25 +0200
commitd8533b4e575d62c9f6f2caedd38d98a1a56fb8d3 (patch)
treecdbfedf7f9abaab651f1130b5bbeea0bc7a0ab09 /scripts/ci-checkpatches.sh
parent716fed6776977db67a0c498b0c3990887903f08d (diff)
parent107b9411e85aad0a48d759fbf0572a631e189a02 (diff)
Sync odp-dpdk with v1.15 release from odpv1.15.0.0_DPDK_17.02
Diffstat (limited to 'scripts/ci-checkpatches.sh')
-rwxr-xr-xscripts/ci-checkpatches.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/ci-checkpatches.sh b/scripts/ci-checkpatches.sh
new file mode 100755
index 000000000..cb1c4e65d
--- /dev/null
+++ b/scripts/ci-checkpatches.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+PATCHES=$1
+echo "Run checkpatch for ${PATCHES}"
+# Generate patches provided with $1.
+# In case of force push and range is broken
+# validate only the latest commit if it's not merge commit.
+git format-patch ${PATCHES}
+if [ $? -ne 0 ]; then
+ git show --summary HEAD| grep -q '^Merge:';
+ if [ $? -ne 0 ]; then
+ git format-patch HEAD^;
+ perl ./scripts/checkpatch.pl *.patch;
+ fi;
+else
+ perl ./scripts/checkpatch.pl *.patch;
+fi