[gnome-commander] Adds pre-commit.sh script for usage with Git
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Adds pre-commit.sh script for usage with Git
- Date: Sun, 13 Mar 2016 14:30:23 +0000 (UTC)
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]