[hitori] Add a pre-commit and pre-applypatch git hook



commit 70a475367f770928bfa3539f6dd4253eea090d4b
Author: Sahil Sareen <sahil sareen hotmail com>
Date:   Sun Dec 27 19:24:28 2015 +0530

    Add a pre-commit and pre-applypatch git hook

 autogen.sh |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index 78f954b..17a92d4 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -8,6 +8,16 @@ test -z "$srcdir" && srcdir=.
        exit 1
 }
 
+# Use the style-checker as pre-commit and pre-applypatch hooks
+if [ -d $srcdir/.git ]; then
+        if [ ! -L $srcdir/.git/hooks/pre-commit ]; then
+            ln -s ../../../libgames-support/style-checker $srcdir/.git/hooks/pre-commit && echo "Enabled 
pre-commit style checker." || :
+        fi
+        if [ ! -L $srcdir/.git/hooks/pre-applypatch ]; then
+            ln -s ../../../libgames-support/style-checker $srcdir/.git/hooks/pre-applypatch && echo "Enabled 
pre-applypatch style checker." || :
+        fi
+fi
+
 PKG_NAME=`autoconf --trace "AC_INIT:$1" "$srcdir/configure.ac"`
 
 if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]