From b41b31e9e47116984aeef8d7a8bc1e9832a8e722 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Mon, 29 Aug 2011 05:55:26 -0300 Subject: Add a make-check check to pre-commit hook --- misc/pre-commit | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'misc') diff --git a/misc/pre-commit b/misc/pre-commit index b25dce6b..1f37d866 100755 --- a/misc/pre-commit +++ b/misc/pre-commit @@ -68,3 +68,19 @@ perl -e ' } exit($found_bad); ' + +CHECK_FILE=.make-check-passed +if ! test -f $CHECK_FILE; then + echo "You need to run make check before committing" + exit 1 +fi + +# Need to run make check at least once every 20 minutes +MODIFIED=`stat -c %Y $CHECK_FILE` +NOW=`date +%s` +DELTA=$(($NOW-MODIFIED)) +if test "$DELTA" -ge "1200"; then + echo "You haven't ran make check in $((DELTA / 60)) minutes." + exit 1 +fi + -- cgit v1.2.1