Skip to content

Commit 0e9f206

Browse files
committed
Merge bitcoin/bitcoin#31063: lint: commit-script-check.sh: echo to stderr
fac6cfe lint: commit-script-check.sh: echo to stderr (MarcoFalke) Pull request description: This makes it easier to redirect the produced `git diff` on failure. On success, it shouldn't hurt, because the same output is still present, just on stderr. Can be tested by introducing a fault in any scripted diff and then calling `commit-script-check.sh HEAD~..HEAD > any_file.txt`. Previously the file contained the full output, now it contains just the diff. ACKs for top commit: TheCharlatan: ACK fac6cfe Tree-SHA512: b4dfad10a4a902729a7ad7533ed0ef86b9e79761083f2ec623d448a551462b268fe04bdba387ca62160dae9ef7b1781e005dec60f18b111d9bfa6b97357108e6
2 parents e8f72ae + fac6cfe commit 0e9f206

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/lint/commit-script-check.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ for commit in $(git rev-list --reverse "$1"); do
3535
git checkout --quiet "$commit"^ || exit
3636
SCRIPT="$(git rev-list --format=%b -n1 "$commit" | sed '/^-BEGIN VERIFY SCRIPT-$/,/^-END VERIFY SCRIPT-$/{//!b};d')"
3737
if test -z "$SCRIPT"; then
38-
echo "Error: missing script for: $commit"
39-
echo "Failed"
38+
echo "Error: missing script for: $commit" >&2
39+
echo "Failed" >&2
4040
RET=1
4141
else
42-
echo "Running script for: $commit"
43-
echo "$SCRIPT"
42+
echo "Running script for: $commit" >&2
43+
echo "$SCRIPT" >&2
4444
(eval "$SCRIPT")
45-
git --no-pager diff --exit-code "$commit" && echo "OK" || (echo "Failed"; false) || RET=1
45+
git --no-pager diff --exit-code "$commit" && echo "OK" >&2 || (echo "Failed" >&2; false) || RET=1
4646
fi
4747
git reset --quiet --hard HEAD
4848
else
4949
if git rev-list "--format=%b" -n1 "$commit" | grep -q '^-\(BEGIN\|END\)[ a-zA-Z]*-$'; then
50-
echo "Error: script block marker but no scripted-diff in title of commit $commit"
51-
echo "Failed"
50+
echo "Error: script block marker but no scripted-diff in title of commit $commit" >&2
51+
echo "Failed" >&2
5252
RET=1
5353
fi
5454
fi

0 commit comments

Comments
 (0)