diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-07 18:23:20 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-07 18:23:20 -0400 |
| commit | 89f9b3cbe16d708912c91db76ed6a2d5cf9851b2 (patch) | |
| tree | c4ad9a2b8d7a2e719288e6d38b537d31d1b7633a /contrib | |
| parent | 6eb4f7a2f9bbabc5c606f624e9b8380a16224690 (diff) | |
| parent | 9556734c02a0b05764e83419ae72710908419cdc (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'contrib')
| -rwxr-xr-x | contrib/post-checkout-hook | 28 |
1 files changed, 28 insertions, 0 deletions
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 |
