File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ install:
43
43
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi
44
44
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi
45
45
before_script :
46
+ - if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then contrib/devtools/commit-script-check.sh $TRAVIS_COMMIT_RANGE; fi
46
47
- unset CC; unset CXX
47
48
- if [ "$CHECK_DOC" = 1 ]; then contrib/devtools/check-doc.py; fi
48
49
- mkdir -p depends/SDKs depends/sdk-sources
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ # Copyright (c) 2017 The Bitcoin Core developers
3
+ # Distributed under the MIT software license, see the accompanying
4
+ # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
+
6
+ # This simple script checks for commits beginning with: scripted-diff:
7
+ # If found, looks for a script between the lines -BEGIN VERIFY SCRIPT- and
8
+ # -END VERIFY SCRIPT-. If no ending is found, it reads until the end of the
9
+ # commit message.
10
+
11
+ # The resulting script should exactly transform the previous commit into the current
12
+ # one. Any remaining diff signals an error.
13
+
14
+ if test " x$1 " = " x" ; then
15
+ echo " Usage: $0 <commit>..."
16
+ exit 1
17
+ fi
18
+
19
+ RET=0
20
+ PREV_BRANCH=` git name-rev --name-only HEAD`
21
+ PREV_HEAD=` git rev-parse HEAD`
22
+ for i in ` git rev-list --reverse $1 ` ; do
23
+ git rev-list -n 1 --pretty=" %s" $i | grep -q " ^scripted-diff:" || continue
24
+ git checkout --quiet $i ^ || exit
25
+ SCRIPT=" ` git rev-list --format=%b -n1 $i | sed ' /^-BEGIN VERIFY SCRIPT-$/,/^-END VERIFY SCRIPT-$/{//!b};d' ` "
26
+ if test " x$SCRIPT " = " x" ; then
27
+ echo " Error: missing script for: $i "
28
+ echo " Failed"
29
+ RET=1
30
+ else
31
+ echo " Running script for: $i "
32
+ echo " $SCRIPT "
33
+ eval " $SCRIPT "
34
+ git --no-pager diff --exit-code $i && echo " OK" || (echo " Failed" ; false) || RET=1
35
+ fi
36
+ git reset --quiet --hard HEAD
37
+ done
38
+ git checkout --quiet $PREV_BRANCH 2> /dev/null || git checkout --quiet $PREV_HEAD
39
+ exit $RET
You can’t perform that action at this time.
0 commit comments