From 8096cc8e9c9ecdfb511c4e1c859def54878f44ee Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Mon, 5 Oct 2009 16:08:10 +0530 Subject: [PATCH] install.pl, pta hook, upgrade doc: - install the post-update hook also - fix bashism in pta-hook Also, since delegation works best with PTA, reflect that in the upgrade doc --- doc/0-UPGRADE.mkd | 3 +++ src/install.pl | 6 ++++++ src/pta-hook.sh | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/0-UPGRADE.mkd b/doc/0-UPGRADE.mkd index 8c80bb7..c106bc7 100644 --- a/doc/0-UPGRADE.mkd +++ b/doc/0-UPGRADE.mkd @@ -35,6 +35,9 @@ have to do it at a "quiet" time or something. src/gl-compile-conf + (if you've already setup "push-to-admin", this step should be replaced by + a "git push". Make a dummy commit if needed, to make the push happen). + And you're done. ### upgrade notes for specific versions diff --git a/src/install.pl b/src/install.pl index 85b8607..017854f 100755 --- a/src/install.pl +++ b/src/install.pl @@ -64,3 +64,9 @@ for my $repo (`find . -type d -name "*.git"`) { system("cp $GL_ADMINDIR/src/update-hook.pl $repo/hooks/update"); chmod 0755, "$repo/hooks/update"; } + +# oh and one of those repos is a bit more special and has an extra hook :) +system("cp $GL_ADMINDIR/src/pta-hook.sh gitolite-admin.git/hooks/post-update"); +system("perl", "-i", "-p", "-e", "s(export GL_ADMINDIR=.*)(export GL_ADMINDIR=$GL_ADMINDIR)", + "gitolite-admin.git/hooks/post-update"); +chmod 0755, "gitolite-admin.git/hooks/post-update"; diff --git a/src/pta-hook.sh b/src/pta-hook.sh index 23a2f23..5009313 100755 --- a/src/pta-hook.sh +++ b/src/pta-hook.sh @@ -16,7 +16,8 @@ mkdir $GL_ADMINDIR/conf/fragments for br in $(git for-each-ref --format='%(refname:short)') do # skip master (duh!) - [[ $br == master ]] && continue + [ "$br" = "master" ] && continue + # all other branches *should* contain a file called .conf # inside conf/fragments; if so copy it if git show $br:conf/fragments/$br.conf > /dev/null 2>&1