diff --git a/src/gitolite.pm b/src/gitolite.pm index baaf112..b6794e4 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -43,9 +43,9 @@ our $ADC_CMD_ARGS_PATT=qr(^[0-9a-zA-Z._\@/+:-]*$); our ($REPO_UMASK, $GL_WILDREPOS, $GL_PACKAGE_CONF, $GL_PACKAGE_HOOKS, $REPO_BASE, $GL_CONF_COMPILED, $GL_BIG_CONFIG, $GL_PERFLOGT, $PROJECTS_LIST, $GL_ALL_INCLUDES_SPECIAL, $GL_SITE_INFO, $GL_GET_MEMBERSHIPS_PGM, $GL_WILDREPOS_PERM_CATS); our %repos; our %groups; -our %repo_config; +our %git_configs; our $data_version; -our $current_data_version = '1.6'; +our $current_data_version = '1.7'; # ---------------------------------------------------------------------------- # convenience subs @@ -453,14 +453,14 @@ sub get_set_desc # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# set/unset repo configs +# set/unset git configs # ---------------------------------------------------------------------------- -sub setup_repo_configs +sub setup_git_configs { - my ($repo, $repo_config_p) = @_; + my ($repo, $git_configs_p) = @_; - while ( my ($key, $value) = each(%{ $repo_config_p->{$repo} }) ) { + while ( my ($key, $value) = each(%{ $git_configs_p->{$repo} }) ) { if ($value) { $value =~ s/^"(.*)"$/$1/; system("git", "config", $key, $value); @@ -588,7 +588,7 @@ sub parse_acl $repos{$dr}{DELETE_IS_D} = 1 if $repos{$r}{DELETE_IS_D}; $repos{$dr}{CREATE_IS_C} = 1 if $repos{$r}{CREATE_IS_C}; $repos{$dr}{NAME_LIMITS} = 1 if $repos{$r}{NAME_LIMITS}; - $repo_config{$dr} = $repo_config{$r} if $repo_config{$r}; + $git_configs{$dr} = $git_configs{$r} if $git_configs{$r}; for my $u ('@all', "$gl_user - wild", @user_plus, keys %perm_cats) { my $du = $gl_user; $du = '@all' if $u eq '@all' or ($perm_cats{$u} || '') eq '@all'; diff --git a/src/gl-auth-command b/src/gl-auth-command index 1ebacb5..e176d56 100755 --- a/src/gl-auth-command +++ b/src/gl-auth-command @@ -37,7 +37,7 @@ our ($GL_LOGT, $GL_CONF_COMPILED, $REPO_BASE, $GIT_PATH, $REPO_UMASK, $GL_ADMIND our ($R_COMMANDS, $W_COMMANDS, $REPONAME_PATT, $REPOPATT_PATT, $ADC_CMD_ARGS_PATT); our %repos; our %groups; -our %repo_config; +our %git_configs; # the common setup module is in the same directory as this running program is my $bindir = $0; @@ -239,7 +239,7 @@ if ($perm =~ /C/) { new_repo($repo, "$GL_ADMINDIR/hooks/common", $user); # note pwd is now the bare "repo.git"; new_repo does that... wrap_print("gl-perms", "$GL_WILDREPOS_DEFPERMS\n") if $GL_WILDREPOS_DEFPERMS; - &setup_repo_configs($repo, \%repo_config); + &setup_git_configs($repo, \%git_configs); &setup_daemon_access($repo); &add_del_line ("$repo.git", $PROJECTS_LIST, &setup_gitweb_access($repo, '', '')); wrap_chdir($ENV{HOME}); diff --git a/src/gl-compile-conf b/src/gl-compile-conf index 443192b..24e703c 100755 --- a/src/gl-compile-conf +++ b/src/gl-compile-conf @@ -105,8 +105,8 @@ our $current_data_version; # this comes from gitolite.pm # catch usernames<->pubkeys mismatches; search for "lint" below my %user_list = (); -# repo configurations -our %repo_config = (); +# repo specific 'git config' stuff +our %git_configs = (); # gitweb descriptions and owners; plain text, keyed by "$repo.git" my %desc = (); @@ -274,7 +274,7 @@ sub parse_conf_line } } } - # configuration + # repo specific 'git config' stuff elsif ($line =~ /^config (.+) = ?(.*)/) { my ($key, $value) = ($1, $2); @@ -283,7 +283,7 @@ sub parse_conf_line die "$ABRT git config $key not allowed\ncheck GL_GITCONFIG_KEYS in the rc file for how to allow it\n" if (@matched < 1); for my $repo (@{ $repos_p }) # each repo in the current stanza { - $repo_config{$repo}{$key} = $value; + $git_configs{$repo}{$key} = $value; # no problem if it's a plain repo (non-pattern, non-groupname) # OR wild configs are allowed unless ( ($repo =~ $REPONAME_PATT and $repo !~ /^@/) or $GL_GITCONFIG_WILD) { @@ -402,7 +402,7 @@ my $compiled_fh = wrap_open( ">", "$GL_CONF_COMPILED.new" ); my $data_version = $current_data_version; print $compiled_fh Data::Dumper->Dump([$data_version], [qw(*data_version)]); my $dumped_data = Data::Dumper->Dump([\%repos], [qw(*repos)]); -$dumped_data .= Data::Dumper->Dump([\%repo_config], [qw(*repo_config)]) if %repo_config; +$dumped_data .= Data::Dumper->Dump([\%git_configs], [qw(*git_configs)]) if %git_configs; # the dump uses single quotes, but we convert any strings containing $creator # and $gl_user to double quoted strings. A bit sneaky, but not too much... $dumped_data =~ s/'(?=[^']*\$(?:creator|gl_user))~?(.*?)'/"$1"/g; @@ -555,9 +555,9 @@ for my $repo (keys %repo_patts) { # calls (setup daemon or gitweb). The reason is that they call # "can_read", which eventually calls parse_acl with the right "creator" # set for the *current* repo, which in turn stores translated values for - # $creator in the repo_config hash, which, (phew!) is needed for a match - # that eventually gets you a valid $repo_config{} below - &setup_repo_configs($repo, \%repo_config) if $repo_config{$repo}; + # $creator in the git_configs hash, which, (phew!) is needed for a match + # that eventually gets you a valid $git_configs{} below + &setup_git_configs($repo, \%git_configs) if $git_configs{$repo}; } # write out the project list diff --git a/t/out/t01-repo-groups.1 b/t/out/t01-repo-groups.1 index 38119e0..2124ba6 100644 --- a/t/out/t01-repo-groups.1 +++ b/t/out/t01-repo-groups.1 @@ -1,4 +1,4 @@ -$data_version = '1.6'; +$data_version = '1.7'; %repos = ( 'aa' => { 'R' => { diff --git a/t/out/t01-repo-groups.1b b/t/out/t01-repo-groups.1b index 90c9850..3275bcf 100644 --- a/t/out/t01-repo-groups.1b +++ b/t/out/t01-repo-groups.1b @@ -1,4 +1,4 @@ -$data_version = '1.6'; +$data_version = '1.7'; %repos = ( 'aa' => { 'R' => { diff --git a/t/out/t01-repo-groups.2 b/t/out/t01-repo-groups.2 index d766ca0..4275510 100644 --- a/t/out/t01-repo-groups.2 +++ b/t/out/t01-repo-groups.2 @@ -1,4 +1,4 @@ -$data_version = '1.6'; +$data_version = '1.7'; %repos = ( '@g1' => { '@g1' => [ diff --git a/t/out/t02-user-groups.1 b/t/out/t02-user-groups.1 index d05ee68..05ba1fb 100644 --- a/t/out/t02-user-groups.1 +++ b/t/out/t02-user-groups.1 @@ -1,4 +1,4 @@ -$data_version = '1.6'; +$data_version = '1.7'; %repos = ( 'aa' => { 'R' => { diff --git a/t/out/t02-user-groups.1b b/t/out/t02-user-groups.1b index d53203f..16d4f1b 100644 --- a/t/out/t02-user-groups.1b +++ b/t/out/t02-user-groups.1b @@ -1,4 +1,4 @@ -$data_version = '1.6'; +$data_version = '1.7'; %repos = ( 'aa' => { 'R' => { diff --git a/t/out/t02-user-groups.2 b/t/out/t02-user-groups.2 index be82819..b4d5fd1 100644 --- a/t/out/t02-user-groups.2 +++ b/t/out/t02-user-groups.2 @@ -1,4 +1,4 @@ -$data_version = '1.6'; +$data_version = '1.7'; %repos = ( 'aa' => { '@g1' => [