2017-03-22 21:18:48 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-04-22 21:36:52 +02:00
|
|
|
# Lint all commit messages that are newer than upstream/master if running
|
2017-07-31 18:27:32 +02:00
|
|
|
# locally or the commits in the push or PR if in Travis CI.
|
2017-04-22 21:36:52 +02:00
|
|
|
|
2017-03-22 21:18:48 +01:00
|
|
|
# The rules can be found in /.gitlint
|
|
|
|
|
2017-04-26 01:50:16 +02:00
|
|
|
if [ "$TRAVIS" ]; then
|
|
|
|
# Work around https://github.com/travis-ci/travis-ci/issues/4596
|
|
|
|
range="${TRAVIS_COMMIT_RANGE/.../..}"
|
2017-04-22 21:36:52 +02:00
|
|
|
else
|
2017-04-26 01:50:16 +02:00
|
|
|
range="upstream/master..HEAD"
|
2017-03-22 21:18:48 +01:00
|
|
|
fi
|
|
|
|
|
2017-04-22 21:36:52 +02:00
|
|
|
gitlint --commits $range
|