static-checks-coding-style.sh: Check entire patch chain
Due to the way LTS vote propagation works, we actually need to test the
entire patch chain. The process is: in case of patch chain, Allow-CI is
set on the final patch in chain, other patches don't really get Allow-CI
votes. So, CI on the final patch should test the entire series, set
Verified vote on it, then this vote is propagated to rest of patches in
series.
Consequently, the changes are:
1. Proper branch should be used to find patch series limit (instead of
hardcoding master).
2. Diagnostics for codestyle checks (and actually all the other CI tests)
should make it clear that it checks entire series (and not just "last
patch").
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: I803a745f7219ce4d0102027f026346a93261ee49
diff --git a/script/static-checks/static-checks-coding-style.sh b/script/static-checks/static-checks-coding-style.sh
index 1c074ef..52bc623 100755
--- a/script/static-checks/static-checks-coding-style.sh
+++ b/script/static-checks/static-checks-coding-style.sh
@@ -9,18 +9,21 @@
# against the Linux coding style using the checkpatch.pl script from
# the Linux kernel source tree.
-TEST_CASE="Coding style on current patch"
+TEST_CASE="Codestyle on the entire patch chain"
-echo "# Check coding style on the last patch"
+echo "# $TEST_CASE"
-git show --summary
+BASE_COMMIT=origin/$TF_GERRIT_BRANCH
+COMMON_COMMIT=$(git merge-base HEAD $BASE_COMMIT)
+
+git log --oneline $COMMON_COMMIT..HEAD
LOG_FILE=$(mktemp -t coding-style-check.XXXX)
chmod +x $CI_ROOT/script/static-checks/checkpatch.pl
CHECKPATCH=$CI_ROOT/script/static-checks/checkpatch.pl \
- make checkpatch BASE_COMMIT=HEAD^ &> "$LOG_FILE"
+ make checkpatch BASE_COMMIT=origin/$TF_GERRIT_BRANCH &> "$LOG_FILE"
RES=$?
if [[ "$RES" == 0 ]]; then