Skip to content

Commit f061da2

Browse files
author
MarcoFalke
committed
Merge #20697: ci: Fix COMMIT_RANGE variable value for PRs
3c2478c ci: Print COMMIT_RANGE to the log as it was in Travis CI (Hennadii Stepanov) c123892 ci: Drop Travis-specific workaround for shellcheck (Hennadii Stepanov) 10af252 ci: Drop Travis-specific way to set COMMIT_RANGE variable (Hennadii Stepanov) 93504da 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 3c2478c Tree-SHA512: beb933352b10fd5eb3e66373ddb62439e4f3a03b50fb037ee89fa92c0706cec41d05f2d307f15bb18d1e634e6464f4e123b7e2f88703c8edfd145d8d6eff0b1a
2 parents e9efb64 + 3c2478c commit f061da2

File tree

6 files changed

+6
-36
lines changed

6 files changed

+6
-36
lines changed

ci/lint/05_before_script.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

ci/lint/06_script.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
export LC_ALL=C
88

9+
GIT_HEAD=$(git rev-parse HEAD)
910
if [ -n "$CIRRUS_PR" ]; then
10-
# CIRRUS_PR will be present in a Cirrus environment. For builds triggered
11-
# by a pull request this is the name of the branch targeted by the pull request.
12-
# https://cirrus-ci.org/guide/writing-tasks/#environment-variables
13-
COMMIT_RANGE="$CIRRUS_BRANCH..HEAD"
11+
COMMIT_RANGE="$CIRRUS_BASE_SHA..$GIT_HEAD"
1412
test/lint/commit-script-check.sh $COMMIT_RANGE
1513
fi
14+
export COMMIT_RANGE
1615

1716
# This only checks that the trees are pure subtrees, it is not doing a full
1817
# check with -r to not have to fetch all the remotes.
@@ -30,3 +29,6 @@ if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ -n "$CIRRUS_CRON" ]; th
3029
${CI_RETRY_EXE} gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $(<contrib/verify-commits/trusted-keys) &&
3130
./contrib/verify-commits/verify-commits.py --clean-merge=2;
3231
fi
32+
33+
echo
34+
git log --no-merges --oneline $COMMIT_RANGE

ci/lint_run_all.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ export LC_ALL=C.UTF-8
88

99
set -o errexit; source ./ci/test/00_setup_env.sh
1010
set -o errexit; source ./ci/lint/04_install.sh
11-
set -o errexit; source ./ci/lint/05_before_script.sh
1211
set -o errexit; source ./ci/lint/06_script.sh

test/lint/lint-git-commit-check.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ while getopts "?" opt; do
2323
esac
2424
done
2525

26-
# TRAVIS_BRANCH will be present in a Travis environment. For builds triggered
27-
# by a pull request this is the name of the branch targeted by the pull request.
28-
# https://docs.travis-ci.com/user/environment-variables/
29-
if [ -n "${TRAVIS_BRANCH}" ]; then
30-
COMMIT_RANGE="$TRAVIS_BRANCH..HEAD"
31-
fi
32-
3326
if [ -z "${COMMIT_RANGE}" ]; then
3427
if [ -n "$1" ]; then
3528
COMMIT_RANGE="HEAD~$1...HEAD"

test/lint/lint-shell.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88

99
export LC_ALL=C
1010

11-
# The shellcheck binary segfault/coredumps in Travis with LC_ALL=C
12-
# It does not do so in Ubuntu 14.04, 16.04, 18.04 in versions 0.3.3, 0.3.7, 0.4.6
13-
# respectively. So export LC_ALL=C is set as required by lint-shell-locale.sh
14-
# but unset here in case of running in Travis.
15-
if [ "$TRAVIS" = "true" ]; then
16-
unset LC_ALL
17-
fi
18-
1911
# Disabled warnings:
2012
disabled=(
2113
SC2046 # Quote this to prevent word splitting.

test/lint/lint-whitespace.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ while getopts "?" opt; do
2222
esac
2323
done
2424

25-
# TRAVIS_BRANCH will be present in a Travis environment. For builds triggered
26-
# by a pull request this is the name of the branch targeted by the pull request.
27-
# https://docs.travis-ci.com/user/environment-variables/
28-
if [ -n "${TRAVIS_BRANCH}" ]; then
29-
COMMIT_RANGE="$TRAVIS_BRANCH..HEAD"
30-
fi
31-
3225
if [ -z "${COMMIT_RANGE}" ]; then
3326
if [ -n "$1" ]; then
3427
COMMIT_RANGE="HEAD~$1...HEAD"

0 commit comments

Comments
 (0)