From 5bb0850c5c628f279c8bd16fdd5583c89402093d Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 2 Oct 2009 23:23:52 +0530 Subject: [PATCH] p-t-a: make the post-update hook a separate file... ...and just refer to it in the doc. This hook will acquire more code soon, when we do delegations :) --- doc/4-push-to-admin.mkd | 19 +++++++------------ src/pta-hook.sh | 6 ++++++ 2 files changed, 13 insertions(+), 12 deletions(-) create mode 100755 src/pta-hook.sh diff --git a/doc/4-push-to-admin.mkd b/doc/4-push-to-admin.mkd index 3fc83bf..4b208a9 100644 --- a/doc/4-push-to-admin.mkd +++ b/doc/4-push-to-admin.mkd @@ -70,20 +70,15 @@ repos they play havoc with my git commands, so this is how I do it) GIT_WORK_TREE=/home/git/.gitolite git add conf/gitolite.conf keydir GIT_WORK_TREE=/home/git/.gitolite git commit -am start -Now we have to setup the post-update hook for push-to-admin to work. The -hook should (1) make a forced checkout in the "live" config directory (which -is `~/.gitolite`), and (2) run the compile script. So we create a hook with -the appropriate code in it, and then make it executable +Now we have to setup the post-update hook for push-to-admin to work. The hook +should (1) make a forced checkout in the "live" config directory (which is +`~/.gitolite`), and (2) run the compile script. - cat < hooks/post-update - #!/bin/sh - - GIT_WORK_TREE=/home/git/.gitolite git checkout -f - - cd /home/git/.gitolite - src/gl-compile-conf - EOFPU +`src/pta-hook.sh` has the code you need; just copy it to the right place with +the right name and make sure it is executable: + # (assuming pwd is still ~/repositories/gitolite-admin.git) + cp ~/.gitolite/src/pta-hook.sh hooks/post-update chmod +x hooks/post-update ---- diff --git a/src/pta-hook.sh b/src/pta-hook.sh new file mode 100755 index 0000000..283cc9f --- /dev/null +++ b/src/pta-hook.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +GIT_WORK_TREE=/home/git/.gitolite git checkout -f + +cd /home/git/.gitolite +src/gl-compile-conf