[gnome-commander] Adds pre-commit.sh script for usage with Git



commit 1e58f646eafe06f79cda1b394af2b42c0fbb13e0
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Sun Mar 13 14:32:11 2016 +0100

    Adds pre-commit.sh script for usage with Git
    
    Just link this script with the following command into the git hook
    directory:
    ln -s ../../pre-commit.sh .git/hooks/pre-commit
    
    Having this done, git will always execute this script before committing.

 pre-commit.sh |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/pre-commit.sh b/pre-commit.sh
new file mode 100755
index 0000000..db1490f
--- /dev/null
+++ b/pre-commit.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+git stash -q --keep-index
+
+make && make check
+
+RESULT=$?
+
+git stash pop -q
+
+[ $RESULT -ne 0 ] && exit 1
+
+exit 0


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