From 0e96c2f08a5f099ac4df668fa460baba1c7cb05a Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Mon, 8 Feb 2010 09:59:27 +0530 Subject: [PATCH] example conf: doc on NAME/ being a refex etc was not clear --- conf/example.conf | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/conf/example.conf b/conf/example.conf index 01ea6d4..e6aac3b 100644 --- a/conf/example.conf +++ b/conf/example.conf @@ -83,6 +83,7 @@ # If none of them match, it fails # what's a refex? a regex to match against the ref being updated (get it?) +# See next section for more on refexes # BASIC PERMISSIONS (repo level only; apply to all branches/tags in repo) @@ -114,13 +115,16 @@ repo @oss_repos repo @all RW+ = @admins -# ADVANCED PERMISSIONS USING REFEXES +# SPECIFYING AND USING A REFEX # - refexes are specified in perl regex syntax -# - refexes are matched without any anchoring, which means a refex like -# "refs/tags/v[0-9]" matches anything *containing* that pattern. There -# may be text before and after it (example: refs/tags/v4-r3p7), and it -# will still match +# - refexes are prefix-matched (they are internally anchored with "^" +# before being used), which means a refex like "refs/tags/v[0-9]" +# matches anything *starting with* that pattern. There may be text +# after it (example: refs/tags/v4-r3/p7), and it will still match + +# ADVANCED PERMISSIONS USING REFEXES + # - if no refex appears, the rule applies to all refs in that repo # - a refex is automatically prefixed by "refs/heads/" if it doesn't start # with "refs/" (so tags have to be explicitly named as @@ -191,7 +195,9 @@ repo foo # Notes -# - the "NAME/" is part of the syntax; think of it as a keyword if you like +# - the "NAME/" is part of the syntax; think of it as a keyword if you like. +# The rest of it is treated as a refex to match against each file being +# touched (see "SPECIFYING AND USING A REFEX" above for details) # - file/dir NAME-based restrictions are *in addition* to normal (branch-name # based) restrictions; they are not a *replacement* for them. This is why @@ -284,7 +290,7 @@ repo gitolite repo EXTCMD/rsync # grant permissions to files/dirs within the $RSYNC_BASE tree. A leading # NAME/ is required as a prefix; the actual path starts after that. Matching -# follows the same rules as elsewhere in gitolite. +# follows the same rules as given in "FILE/DIR NAME BASED RESTRICTIONS" above RW NAME/ = sitaram RW NAME/foo/ = user1 R NAME/bar/ = user2