From 802cb9521fa2079035e0d18bfd4dcb71a7ec02ec Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 21 Dec 2020 12:08:35 +0100 Subject: [PATCH] Merge #20697: ci: Fix COMMIT_RANGE variable value for PRs 3c2478c38522c176e81befd4d991a259b09be063 ci: Print COMMIT_RANGE to the log as it was in Travis CI (Hennadii Stepanov) c123892c2e47e3706f06820aba2454d494a39564 ci: Drop Travis-specific workaround for shellcheck (Hennadii Stepanov) 10af252d97532843b26505d215f6e975f4b21672 ci: Drop Travis-specific way to set COMMIT_RANGE variable (Hennadii Stepanov) 93504da3a932f33126545ebc9383f695a6efe51e ci: Fix COMMIT_RANGE variable value for PRs (Hennadii Stepanov) Pull request description: This PR: - is a #20658 and #20682 followup - set the `COMMIT_RANGE` variable correctly for PRs - cleans up Travis-specific code - prints COMMIT_RANGE value to the log for convenience as it was in Travis CI ACKs for top commit: MarcoFalke: ACK 3c2478c38522c176e81befd4d991a259b09be063 Tree-SHA512: beb933352b10fd5eb3e66373ddb62439e4f3a03b50fb037ee89fa92c0706cec41d05f2d307f15bb18d1e634e6464f4e123b7e2f88703c8edfd145d8d6eff0b1a --- ci/lint/05_before_script.sh | 9 --------- ci/lint/06_script.sh | 10 ++++++---- ci/lint_run_all.sh | 1 - test/lint/lint-shell.sh | 8 -------- 4 files changed, 6 insertions(+), 22 deletions(-) delete mode 100755 ci/lint/05_before_script.sh diff --git a/ci/lint/05_before_script.sh b/ci/lint/05_before_script.sh deleted file mode 100755 index 8e5a177b01..0000000000 --- a/ci/lint/05_before_script.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2018-2019 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C - -git fetch diff --git a/ci/lint/06_script.sh b/ci/lint/06_script.sh index 59585d2e53..7251b7575c 100755 --- a/ci/lint/06_script.sh +++ b/ci/lint/06_script.sh @@ -6,13 +6,12 @@ export LC_ALL=C +GIT_HEAD=$(git rev-parse HEAD) if [ -n "$CIRRUS_PR" ]; then - # CIRRUS_PR will be present in a Cirrus environment. For builds triggered - # by a pull request this is the name of the branch targeted by the pull request. - # https://cirrus-ci.org/guide/writing-tasks/#environment-variables - COMMIT_RANGE="$CIRRUS_BRANCH..HEAD" + COMMIT_RANGE="$CIRRUS_BASE_SHA..$GIT_HEAD" test/lint/commit-script-check.sh $COMMIT_RANGE fi +export COMMIT_RANGE # This only checks that the trees are pure subtrees, it is not doing a full # check with -r to not have to fetch all the remotes. @@ -29,3 +28,6 @@ if [ "$CIRRUS_REPO_FULL_NAME" = "dashpay/dash" ] && [ -n "$CIRRUS_CRON" ]; then ${CI_RETRY_EXE} gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $(