summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2009-10-03 02:24:29 +0200
committerSebastian Pipping <sebastian@pipping.org>2009-10-03 02:24:29 +0200
commit547479afc517266d1325afc47a203d6bb7922ce9 (patch)
tree70fa724cbdc9ee01143976a4f97d5b251e5f0622
parentMake gitosis.conf merge script work from a post-update git hook (diff)
downloadrepositories-xml-format-547479afc517266d1325afc47a203d6bb7922ce9.tar.gz
repositories-xml-format-547479afc517266d1325afc47a203d6bb7922ce9.tar.bz2
repositories-xml-format-547479afc517266d1325afc47a203d6bb7922ce9.zip
Add post-update Git hook sample
-rwxr-xr-xpost-update.sample.gitosis-conf-merge27
1 files changed, 27 insertions, 0 deletions
diff --git a/post-update.sample.gitosis-conf-merge b/post-update.sample.gitosis-conf-merge
new file mode 100755
index 0000000..75646fc
--- /dev/null
+++ b/post-update.sample.gitosis-conf-merge
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+# Copyright (C) 2009 Sebastian Pipping <sebastian@pipping.org>
+# Licensed under GPL 2 or later
+
+# CONFIG
+SCRIPT_PWD=/home/sping/__playground/overlays-xml-specification/
+SCRIPT_TO_CALL=./merge-gitosis-conf-into-repositories-xml.py
+REPOSITORIES_XML_LOCATION=repositories.xml
+
+
+echo ==============================================================
+GITOSIS_CONF_TEMPFILE=$(mktemp)
+git --bare show HEAD:gitosis.conf > "${GITOSIS_CONF_TEMPFILE}"
+(
+ echo \# cd \"${SCRIPT_PWD}\"
+ cd "${SCRIPT_PWD}" || exit 1
+
+ echo \# \"${SCRIPT_TO_CALL}\" \"${GITOSIS_CONF_TEMPFILE}\" \
+ \"${REPOSITORIES_XML_LOCATION}\"
+ "${SCRIPT_TO_CALL}" \
+ "${GITOSIS_CONF_TEMPFILE}" \
+ "${REPOSITORIES_XML_LOCATION}"
+ res=$?
+ echo "--> ${res}"
+)
+rm "${GITOSIS_CONF_TEMPFILE}"
+echo ==============================================================