From 67607760e5dd551e2fbfd24fa1114aa33a154894 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 9 Apr 2010 21:49:54 +0530 Subject: [PATCH] bypass update hook if GL_BYPASS_UPDATE_HOOK is available in ENV people with shell access should be allowed to bypass the update hook, to allow them to clone locally and push. You can now do this by setting an env var that the ssh "front door" will never set, like so: GL_BYPASS_UPDATE_HOOK=1 git push Note that this will NOT work for the gitolite-admin repo, because the post-update hook on that one requires a bit more. If you really want to do that, try: GL_ADMINDIR=~/.gitolite GL_BINDIR=~/.gitolite/src GL_BYPASS_UPDATE_HOOK=1 git push (assuming default values in ~/.gitolite.rc) --- hooks/common/update | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hooks/common/update b/hooks/common/update index 3f85c2b..2a3e3e6 100755 --- a/hooks/common/update +++ b/hooks/common/update @@ -28,6 +28,10 @@ use warnings; our ($GL_CONF_COMPILED); our %repos; +# people with shell access should be allowed to bypass the update hook, simply +# by setting an env var that the ssh "front door" will never set +exit 0 if exists $ENV{GL_BYPASS_UPDATE_HOOK}; + # we should already have the GL_RC env var set when we enter this hook die "parse $ENV{GL_RC} failed: " . ($! or $@) unless do $ENV{GL_RC}; # then "do" the compiled config file, whose name we now know. Before doing