From 23b8cea779227d2ff1f0d378ec3612906adf1008 Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Wed, 20 Sep 2017 09:38:50 +0200 Subject: [PATCH] ci: .shippable.yml: fix commit range When building a pull request, we want to run checkpatch on each commit included in the pull request. Unfortunately, it is not what the current code does, because $SHIPPABLE_COMMIT_RANGE contains a three-dot notation such as: .... This syntax is interpreted differently depending on the git command that parses it. Quoting git help diff: git diff [--options] [--] [...] This is to view the changes between two arbitrary . git diff [--options] .. [--] [...] This is synonymous to the previous form. git diff [--options] ... [--] [...] This form is to view the changes on the branch containing and up to the second , starting at a common ancestor of both . Quoting git help revisions (documents the format used by git log or git rev-list): .. Include commits that are reachable from but exclude those that are reachable from . ... Include commits that are reachable from either or but exclude those that are reachable from both. In other words, three dots for git diff is like two dots for git log or git rev-list. What we need to use with git rev-list is the two dot notation. Signed-off-by: Jerome Forissier Acked-by: Jens Wiklander --- .shippable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.shippable.yml b/.shippable.yml index 15c821a8132..e0f0b1c7a70 100644 --- a/.shippable.yml +++ b/.shippable.yml @@ -44,7 +44,7 @@ build: checkpatch HEAD || export checkpatch_failed=1; else echo "Running checkpatch on each patch in pull request:"; - for c in $(git rev-list --reverse ${SHIPPABLE_COMMIT_RANGE}); do + for c in $(git rev-list --reverse $(echo ${SHIPPABLE_COMMIT_RANGE} | sed 's/\.\.\./../')); do checkpatch $c || export checkpatch_failed=1; done; fi;