compile: support "repo @all" definitions

"repo @all" can be used to set permissions or configurations for all
already defined repos.  (A repository is defined if it has permission
rules associated, empty "repo" stanza or "@group=..." line is not enough.)

For example to allow a backup user to clone all repos:

  # All other configuration
  [...]
  repo @all
       R = backup

Signed-off-by: Teemu Matilainen <teemu.matilainen@reaktor.fi>
This commit is contained in:
Teemu Matilainen 2009-12-21 01:55:45 +02:00 committed by Sitaram Chamarty
parent 6f45f75ca1
commit f37fb45144
2 changed files with 12 additions and 1 deletions

View file

@ -101,6 +101,13 @@ repo gitolite
repo @oss_repos
R = @all
# set permissions to all already defined repos
# (a repository is defined if it has permission rules
# associated, empty "repo" stanza or "@group=..." line is
# not enough)
repo @all
RW+ = @admins
# ADVANCED PERMISSIONS USING REFEXES
# - refexes are specified in perl regex syntax

View file

@ -185,7 +185,11 @@ sub parse_conf_file
{
# grab the list and expand any @stuff in it
@repos = split ' ', $1;
@repos = expand_list ( @repos );
if (@repos == 1 and $repos[0] eq '@all') {
@repos = keys %repos;
} else {
@repos = expand_list ( @repos );
}
}
# actual permission line
elsif (/^(-|R|RW|RW\+) (.* )?= (.+)/)