From 455ebe1bc99706efa7c1e6a6ba01793c0d8554c0 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Wed, 2 Sep 2009 06:49:04 +0530 Subject: [PATCH] update hook: personal branches pattern, "-" becomes "/" --- doc/3-faq-tips-etc.mkd | 7 ++++--- src/update-hook.pl | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/3-faq-tips-etc.mkd b/doc/3-faq-tips-etc.mkd index 19ead5e..ea3c3a7 100644 --- a/doc/3-faq-tips-etc.mkd +++ b/doc/3-faq-tips-etc.mkd @@ -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 diff --git a/src/update-hook.pl b/src/update-hook.pl index 526cf1d..41d6f76 100755 --- a/src/update-hook.pl +++ b/src/update-hook.pl @@ -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 :) {