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)
This commit is contained in:
Sitaram Chamarty 2010-04-09 21:49:54 +05:30
parent 246165537d
commit 67607760e5

View file

@ -28,6 +28,10 @@ use warnings;
our ($GL_CONF_COMPILED); our ($GL_CONF_COMPILED);
our %repos; 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 # 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}; 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 # then "do" the compiled config file, whose name we now know. Before doing