Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fork ADC: stop carrying along non-gitolite hooks

When someone adds a repo-specific hook to their repo, then create a
'fork' via the fork ADC, this repo-specific hook also get carried
across, but should not.
  • Loading branch information...
commit d3b2dda5df442e543197d4349cf6d85a885d744d 1 parent a6ab6cd
Sitaram Chamarty authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 contrib/adc/fork
10 contrib/adc/fork
View
@@ -24,7 +24,15 @@ echo $GL_USER > gl-creater
git config gitweb.owner "$GL_USER"
( $GL_BINDIR/gl-query-rc GL_WILDREPOS_DEFPERMS ) |
SSH_ORIGINAL_COMMAND="setperms $to" $GL_BINDIR/gl-auth-command $GL_USER
-cp -R $GL_REPO_BASE_ABS/$from.git/hooks/* $GL_REPO_BASE_ABS/$to.git/hooks
+
+# symlink hooks
+shopt -s nullglob
+# the order is important; "package" hooks must override same-named "user" hooks
+for i in `$GL_BINDIR/gl-query-rc GL_ADMINDIR`/hooks/common/* \
+ `$GL_BINDIR/gl-query-rc GL_PACKAGE_HOOKS `/common/*
+do
+ ln -sf $i $GL_REPO_BASE_ABS/$to.git/hooks
+done
if [ -n "$GL_WILDREPOS_DEFPERMS" ]; then
echo "$GL_WILDREPOS_DEFPERMS" > gl-perms
Please sign in to comment.
Something went wrong with that request. Please try again.