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