From e970327cc1d41962df398026656c8b88fc547f53 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Wed, 17 Aug 2011 21:27:48 +0530 Subject: [PATCH] rc: get rid of GL_GITCONFIG_WILD was only for efficiency even when it was relevant, and now it's just in the way, making useless noises. --- conf/example.gitolite.rc | 1 - doc/gitolite.rc.mkd | 6 ------ doc/mirroring.mkd | 4 ++-- src/gitolite_rc.pm | 2 +- src/gl-compile-conf | 10 ---------- t/t55-repo-configs-wild-without-CREATOR | 5 +---- t/t56-repo-configs-wild-with-CREATOR | 5 +---- t/test-driver.sh | 6 +++++- 8 files changed, 10 insertions(+), 29 deletions(-) diff --git a/conf/example.gitolite.rc b/conf/example.gitolite.rc index b80d0ba..dbde473 100644 --- a/conf/example.gitolite.rc +++ b/conf/example.gitolite.rc @@ -45,7 +45,6 @@ $GL_NO_DAEMON_NO_GITWEB = 0; # $GL_ALL_READ_ALL = 0; $GIT_PATH=""; $GL_GITCONFIG_KEYS = ""; -# $GL_GITCONFIG_WILD = 0; $GL_NO_CREATE_REPOS = 0; $GL_NO_SETUP_AUTHKEYS = 0; # $GL_WILDREPOS_DEFPERMS = 'R @all'; diff --git a/doc/gitolite.rc.mkd b/doc/gitolite.rc.mkd index b54ae51..5b442f7 100644 --- a/doc/gitolite.rc.mkd +++ b/doc/gitolite.rc.mkd @@ -154,12 +154,6 @@ on feedback from my users to find or fix issues. `\\.` (two backslashes and a dot). So this is how you'd allow any keys in the "foo" category: `$GL_GITCONFIG_KEYS = "foo\\..*";` - * `$GL_GITCONFIG_WILD`, boolean, default 0 - - This setting allows gitconfig keys even for wild repos. This is an - efficiency issue more than a security issue, since this requires trawling - through all of `$REPO_BASE` looking for stuff :) - * `$GL_NO_CREATE_REPOS`, boolean, default 0 DO NOT CHANGE THIS unless you have other means to create repos and diff --git a/doc/mirroring.mkd b/doc/mirroring.mkd index 349d0bd..66debf7 100644 --- a/doc/mirroring.mkd +++ b/doc/mirroring.mkd @@ -643,8 +643,8 @@ Then write a cron job that looks like this (untested). If you're paranoid enough to use mirrors, you should be paranoid enough to use the `receive.fsckObjects` setting. However, informal tests indicate a 40-50% CPU overhead from this. If you're ok with that, make the appropriate -adjustments to `GL_GITCONFIG_KEYS` and possibly `GL_GITCONFIG_WILD` in the rc -file, then add this to your gitolite.conf file: +adjustments to `GL_GITCONFIG_KEYS` in the rc file, then add this to your +gitolite.conf file: repo @all config receive.fsckObjects = "true" diff --git a/src/gitolite_rc.pm b/src/gitolite_rc.pm index 03934c1..01bcba2 100644 --- a/src/gitolite_rc.pm +++ b/src/gitolite_rc.pm @@ -17,7 +17,7 @@ use Exporter 'import'; $ADMIN_POST_UPDATE_CHAINS_TO $ENV $GITOLITE_BASE $GITOLITE_PATH $GIT_PATH $GL_ADC_PATH $GL_ADMINDIR $GL_ALL_INCLUDES_SPECIAL $GL_ALL_READ_ALL $GL_BIG_CONFIG $GL_CONF $GL_CONF_COMPILED $GL_GET_MEMBERSHIPS_PGM - $GL_GITCONFIG_KEYS $GL_GITCONFIG_WILD $GL_KEYDIR $GL_LOGT $GL_NICE_VALUE + $GL_GITCONFIG_KEYS $GL_KEYDIR $GL_LOGT $GL_NICE_VALUE $GL_NO_CREATE_REPOS $GL_NO_DAEMON_NO_GITWEB $GL_NO_SETUP_AUTHKEYS $GL_PACKAGE_CONF $GL_PACKAGE_HOOKS $GL_PERFLOGT $GL_SITE_INFO $GL_SLAVE_MODE $GL_WILDREPOS $GL_WILDREPOS_DEFPERMS diff --git a/src/gl-compile-conf b/src/gl-compile-conf index 8a57a17..273786f 100755 --- a/src/gl-compile-conf +++ b/src/gl-compile-conf @@ -250,16 +250,6 @@ sub parse_conf_line # force entry in %repos. Without this, a repo para with just a # config line and no ACLs gets ignored in the output $repos{$repo}{HAS_CONFIG} = 1; - - # 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) { - my @r = ($repo); # single wildpatt - @r = sort keys %{ $groups{$repo} } if $groups{$repo}; # or a group; get its members - do { - warn "$WARN git config set for $_ but \$GL_GITCONFIG_WILD not set\n" unless $_ =~ $REPONAME_PATT - } for @r; - } } } # include diff --git a/t/t55-repo-configs-wild-without-CREATOR b/t/t55-repo-configs-wild-without-CREATOR index e3abb13..e49effa 100644 --- a/t/t55-repo-configs-wild-without-CREATOR +++ b/t/t55-repo-configs-wild-without-CREATOR @@ -1,7 +1,7 @@ # vim: syn=sh: for bc in 0 1 do - for gcw in 0 1 + for gcw in 0 do cd $TESTDIR $TESTDIR/rollback || die "rollback failed" @@ -9,7 +9,6 @@ do name INTERNAL editrc GL_WILDREPOS 1 editrc GL_BIG_CONFIG $bc - echo "\$GL_GITCONFIG_WILD = $gcw;" | addrc # ---------- @@ -47,8 +46,6 @@ do RW = @leads config foo.bar = baz " | ugc -r - [ "$gcw" = "0" ] && expect "remote: git config set for bar/..\* but \$GL_GITCONFIG_WILD not set" - [ "$gcw" = "1" ] && notexpect "remote: git config set for bar/..\* but \$GL_GITCONFIG_WILD not set" notexpect "git config.*not allowed" expect_push_ok "master -> master" diff --git a/t/t56-repo-configs-wild-with-CREATOR b/t/t56-repo-configs-wild-with-CREATOR index ca0977e..f6dc949 100644 --- a/t/t56-repo-configs-wild-with-CREATOR +++ b/t/t56-repo-configs-wild-with-CREATOR @@ -1,12 +1,11 @@ # vim: syn=sh: -for gcw in 0 1 +for gcw in 0 do cd $TESTDIR $TESTDIR/rollback || die "rollback failed" name INTERNAL editrc GL_WILDREPOS 1 - echo "\$GL_GITCONFIG_WILD = $gcw;" | addrc # ---------- @@ -42,8 +41,6 @@ do RW = @leads config foo.bar = baz " | ugc -r - [ "$gcw" = "0" ] && expect "remote: git config set for bar/\$creator/..\* but \$GL_GITCONFIG_WILD not set" - [ "$gcw" = "1" ] && notexpect "remote: git config set for bar/\$creator/..\* but \$GL_GITCONFIG_WILD not set" notexpect "git config.*not allowed" expect_push_ok "master -> master" diff --git a/t/test-driver.sh b/t/test-driver.sh index ae88c5a..833deee 100755 --- a/t/test-driver.sh +++ b/t/test-driver.sh @@ -117,7 +117,9 @@ expect_filesame() { die() { echo '***** AAAAARRRGGH! *****' >&2 echo ${BASH_LINENO[1]} ${BASH_SOURCE[2]} >&2 - echo "vim +${BASH_LINENO[1]} \'+r !head ~/1 ~/2 /dev/null\' ${BASH_SOURCE[2]}" >&2 + cd $TESTDIR + vim +${BASH_LINENO[1]} '+r !head ~/1 ~/2 /dev/null' ${BASH_SOURCE[2]} + exit 1 } @@ -126,6 +128,7 @@ expect() { then ok else + die foo notok "expecting: $1, got:" cat ~/1 ~/2|sed -e 's/^/# /' fi @@ -134,6 +137,7 @@ expect() { notexpect() { if cat ~/1 ~/2 | grep "$1" >/dev/null then + die foo notok "NOT expecting: $1, got:" cat ~/1 ~/2|sed -e 's/^/# /' else