Skip to content

Commit

Permalink
bypass update hook if GL_BYPASS_UPDATE_HOOK is available in ENV
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
sitaramc committed Apr 9, 2010
1 parent 2461655 commit 6760776
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hooks/common/update
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6760776

Please sign in to comment.