update hook: personal branches pattern, "-" becomes "/"

This commit is contained in:
Sitaram Chamarty 2009-09-02 06:49:04 +05:30
parent 4fa1ca6652
commit 455ebe1bc9
2 changed files with 5 additions and 4 deletions

View file

@ -98,10 +98,11 @@ In gitolite, it's simple: just ask nicely :-)
So I know what gitolite calls me. Big deal... who cares?
Here is a cool idea: allow me to create, rewind, or delete any branch whose
full name matches this pattern:
Here is an idea: give every developer a personal "scratch" namespace within
which she can create, rewind, or delete any branch. For example, I would own
anything under
$PERSONAL_BRANCH_PREFIX/sitaram-.*
$PERSONAL_BRANCH_PREFIX/sitaram/
The admin could set `$PERSONAL_BRANCH_PREFIX` in the rc file and communicate
this to all users. It could be something like `refs/heads/personal`, which

View file

@ -62,7 +62,7 @@ $perm = '+' if $oldsha ne $merge_base;
my @allowed_refs;
push @allowed_refs, @ { $repos{$ENV{GL_REPO}}{$perm}{$ENV{GL_USER}} || [] };
push @allowed_refs, @ { $repos{$ENV{GL_REPO}}{$perm}{'@all'} || [] };
push @allowed_refs, "$PERSONAL/$ENV{GL_USER}-" if $PERSONAL;
push @allowed_refs, "$PERSONAL/$ENV{GL_USER}/" if $PERSONAL;
for my $refex (@allowed_refs)
# refex? sure -- a regex to match a ref against :)
{