From f37fb451447639b6ceeb1f389f371068ba5b0b90 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Mon, 21 Dec 2009 01:55:45 +0200 Subject: [PATCH] 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 --- conf/example.conf | 7 +++++++ src/gl-compile-conf | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/conf/example.conf b/conf/example.conf index 84ccff2..6204c91 100644 --- a/conf/example.conf +++ b/conf/example.conf @@ -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 diff --git a/src/gl-compile-conf b/src/gl-compile-conf index b8e8a1c..4c34d1d 100755 --- a/src/gl-compile-conf +++ b/src/gl-compile-conf @@ -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\+) (.* )?= (.+)/)