diff options
author | Craig Earls <enderw88@gmail.com> | 2014-12-30 20:48:52 -0800 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2014-12-30 20:48:52 -0800 |
commit | 7cd3a7fc9d6af64846a742bdd2ad07cb6dde0bf9 (patch) | |
tree | 7c569daa1137920ad3cc9ab32d574d24e24d0dc6 /tools/prepare-commit-msg | |
parent | b6cef4bc507712427e9c5e83495ba5104679712d (diff) | |
parent | 8e79b3c7c74081b63f9d8b1e0ec97478f61d4ba8 (diff) | |
download | fork-ledger-7cd3a7fc9d6af64846a742bdd2ad07cb6dde0bf9.tar.gz fork-ledger-7cd3a7fc9d6af64846a742bdd2ad07cb6dde0bf9.tar.bz2 fork-ledger-7cd3a7fc9d6af64846a742bdd2ad07cb6dde0bf9.zip |
Merge commit '8e79b3c7c74081b63f9d8b1e0ec97478f61d4ba8'
Diffstat (limited to 'tools/prepare-commit-msg')
-rwxr-xr-x | tools/prepare-commit-msg | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/prepare-commit-msg b/tools/prepare-commit-msg new file mode 100755 index 00000000..e103888a --- /dev/null +++ b/tools/prepare-commit-msg @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Prepare git commit message: +# - Add [ci skip] if the changes seem irrelevant for continuous integration + +# Add [ci skip] to the commit message unless there are changes to files +# that are relevant for testing such as src/*, test/*, ledger3.texi, ... +function add_ci_skip() +{ + pattern="$1"; shift + if [ $(git diff --cached --name-only | grep --count "$pattern") -eq 0 ]; then + tempfile=$(mktemp $0.XXXXXX) + cat - "$1" <<EOF > "$tempfile" + +# It seems the changes to be committed are irrelevant for the continuous +# integration, therefore it will be skipped for this commit. +# +# If you still want continuous integration to run for this commit +# comment or remove the next line. +[ci skip] +EOF + mv "$tempfile" "$1" + fi +} + +## MAIN +add_ci_skip '\(^src\|^test\|^doc/ledger3.texi\|^\.travis.yml\|CMakeLists.txt\)' "$@" |