aboutsummaryrefslogtreecommitdiff
path: root/incoming
diff options
context:
space:
mode:
Diffstat (limited to 'incoming')
-rwxr-xr-xincoming/post-local/99-ls3
-rwxr-xr-xincoming/pre-local/00-git-pull20
-rwxr-xr-xincoming/pre-local/01-hg-pull20
3 files changed, 43 insertions, 0 deletions
diff --git a/incoming/post-local/99-ls b/incoming/post-local/99-ls
new file mode 100755
index 0000000..1c1b79f
--- /dev/null
+++ b/incoming/post-local/99-ls
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+ls --color=auto
diff --git a/incoming/pre-local/00-git-pull b/incoming/pre-local/00-git-pull
new file mode 100755
index 0000000..4e42eb2
--- /dev/null
+++ b/incoming/pre-local/00-git-pull
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+function pull_and_update_repo {
+ git pull
+}
+
+function test_if_working_directory_clean {
+ git status 2>&1 | grep 'nothing.*commit' > /dev/null && pull_and_update_repo
+}
+
+function test_if_in_repo_root {
+ [ -d .git ] && test_if_working_directory_clean
+}
+
+function test_if_git_repo {
+ git status 2>&1 | grep 'fatal: Not a git repository' > /dev/null || test_if_in_repo_root
+}
+
+test_if_git_repo
+exit 0
diff --git a/incoming/pre-local/01-hg-pull b/incoming/pre-local/01-hg-pull
new file mode 100755
index 0000000..bbc9336
--- /dev/null
+++ b/incoming/pre-local/01-hg-pull
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+function pull_and_update_repo {
+ hg pull --update
+}
+
+function test_if_working_directory_clean {
+ hg status --all 2>&1 | egrep -v '^C' > /dev/null || pull_and_update_repo
+}
+
+function test_if_in_repo_root {
+ [ -d .hg ] && test_if_working_directory_clean
+}
+
+function test_if_hg_repo {
+ hg status 2>&1 | grep 'abort: no repository found' > /dev/null || test_if_in_repo_root
+}
+
+test_if_hg_repo
+exit 0