[gnome-commander/gcmd-1-4] 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/gcmd-1-4] Adds pre-commit.sh script for usage with Git
- Date: Sun, 13 Mar 2016 21:08:47 +0000 (UTC)
commit 09f75ac1b1313f020e5cb33a931357ea49cebef4
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]