summaryrefslogtreecommitdiff
path: root/commit.d
diff options
context:
space:
mode:
authorL. Alberto Giménez <agimenez@sysvalve.es>2012-11-18 23:51:20 +0100
committerL. Alberto Giménez <agimenez@sysvalve.es>2012-11-18 23:51:20 +0100
commit5f6c02e23aa11e8840bbe5c59c9e3ff670e81397 (patch)
treecc0c9bae683a2533a75205bd9ed289a99c8b0089 /commit.d
parentcfd2efaab79f8791fc653abf4bd88eaf7a459dad (diff)
Add support for auto-pushing after a commit
A new variable is introduced that will cause etckeeper to push to a configuration-defined remote.
Diffstat (limited to 'commit.d')
-rwxr-xr-xcommit.d/99git-push10
1 files changed, 10 insertions, 0 deletions
diff --git a/commit.d/99git-push b/commit.d/99git-push
new file mode 100755
index 0000000..0c3cdd1
--- /dev/null
+++ b/commit.d/99git-push
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+if [ "$VCS" = git ] && [ -d .git ] && [ -n "$PUSH_REMOTE" ]; then
+ if git config --get remote.$PUSH_REMOTE.url; then
+ git push $PUSH_REMOTE master
+ else
+ echo "etckeeper warning: Configured remote '$PUSH_REMOTE' is unknown to git"
+ fi
+fi