summaryrefslogtreecommitdiffstats
path: root/test/API/driver/kwsys/GitSetup/pre-commit
diff options
context:
space:
mode:
Diffstat (limited to 'test/API/driver/kwsys/GitSetup/pre-commit')
-rw-r--r--test/API/driver/kwsys/GitSetup/pre-commit26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/API/driver/kwsys/GitSetup/pre-commit b/test/API/driver/kwsys/GitSetup/pre-commit
new file mode 100644
index 0000000..1f1d3f5
--- /dev/null
+++ b/test/API/driver/kwsys/GitSetup/pre-commit
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+egrep-q() {
+ egrep "$@" >/dev/null 2>/dev/null
+}
+
+die() {
+ echo 'pre-commit hook failure' 1>&2
+ echo '-----------------------' 1>&2
+ echo '' 1>&2
+ echo "$@" 1>&2
+ exit 1
+}
+
+#-----------------------------------------------------------------------------
+
+# Check that developmer setup is up-to-date.
+lastSetupForDevelopment=$(git config --get hooks.SetupForDevelopment || echo 0)
+eval $(grep '^SetupForDevelopment_VERSION=' "${BASH_SOURCE%/*}/../SetupForDevelopment.sh")
+test -n "$SetupForDevelopment_VERSION" || SetupForDevelopment_VERSION=0
+if test $lastSetupForDevelopment -lt $SetupForDevelopment_VERSION; then
+ die 'Developer setup in this work tree is out of date. Please re-run
+
+ ./SetupForDevelopment.sh
+'
+fi