summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2016-03-07 18:20:31 -0400
committerJoey Hess2016-03-07 18:20:31 -0400
commit9556734c02a0b05764e83419ae72710908419cdc (patch)
treed60d67bb93a978f0cdce026d89ad46ae61d68487
parent2be51d0332a14fae68d18e61ed448a659ed789b1 (diff)
got tired of needing to cherry-pick changes into joeyconfig, wrote a hook
So, when I merge some branch into joeyconfig, config.hs will automatically be updated to point to joeyconfig.hs again, even if the merge changes it. And, when I merge joeyconfig into master, config.hs will be pointed back to config-simple.hs This may also be useful for others who maintain a branch like joeyconfig.
l---------config.hs2
-rwxr-xr-xcontrib/post-checkout-hook28
-rw-r--r--doc/index.mdwn2
-rw-r--r--joeyconfig.hs (renamed from config-joey.hs)0
-rw-r--r--propellor.cabal3
5 files changed, 32 insertions, 3 deletions
diff --git a/config.hs b/config.hs
index 07959a0a..97d90636 120000
--- a/config.hs
+++ b/config.hs
@@ -1 +1 @@
-config-joey.hs \ No newline at end of file
+joeyconfig.hs \ No newline at end of file
diff --git a/contrib/post-checkout-hook b/contrib/post-checkout-hook
new file mode 100755
index 00000000..38998398
--- /dev/null
+++ b/contrib/post-checkout-hook
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# git post-checkout hook, used by propellor's author to maintain a
+# joeyconfig branch where config.hs is a symlink to joeyconfig.hs
+#
+# Each time this hook is run, it checks if it's on a branch with
+# name ending in "config". If so, config.hs is pointed at $branch.hs
+# Otherwise, config.hs is pointed at config-simple.hs
+#
+
+set -e
+prevhead="$1"
+newhead="$2"
+branchcheckout="$3"
+if [ "$branchcheckout" != 0 ]; then
+ branch="$(git symbolic-ref --short HEAD)"
+ case "$branch" in
+ "")
+ true
+ ;;
+ *config)
+ ln -sf "$branch".hs config.hs
+ ;;
+ *)
+ ln -sf config-simple.hs config.hs
+ ;;
+ esac
+fi
diff --git a/doc/index.mdwn b/doc/index.mdwn
index 5961ae87..52c23021 100644
--- a/doc/index.mdwn
+++ b/doc/index.mdwn
@@ -4,7 +4,7 @@
[[Install]]
[API documentation](http://hackage.haskell.org/package/propellor)
[[Other Documentation|documentation]]
-[Sample config file](http://git.joeyh.name/?p=propellor.git;a=blob;f=config-joey.hs)
+[Sample config file](http://git.joeyh.name/?p=propellor.git;a=blob;f=joeyconfig.hs)
[[Security]]
[[Todo]]
[[Forum]]
diff --git a/config-joey.hs b/joeyconfig.hs
index bab8f466..bab8f466 100644
--- a/config-joey.hs
+++ b/joeyconfig.hs
diff --git a/propellor.cabal b/propellor.cabal
index 7c781c43..1366d89e 100644
--- a/propellor.cabal
+++ b/propellor.cabal
@@ -16,8 +16,9 @@ Extra-Source-Files:
CHANGELOG
Makefile
config-simple.hs
- config-joey.hs
+ joeyconfig.hs
config.hs
+ contrib/post-checkout-hook
debian/changelog
debian/README.Debian
debian/compat