Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm several git repositories accessible to different users. I want to allow the users to browse all repos he or she has at least READ access to.

To achieve this I have the following gitweb config:

$projectroot = '/var/lib/gitolite/repositories/';
$site_name = "my Git Repos";
$fallback_encoding = 'utf-8';
$projects_list = '/var/lib/gitolite/projects.list';
$strict_export = 1;

$export_auth_hook = sub {
    my $repo = shift;
    my $user = $ENV{GL_USER};
    # gitweb passes us the full repo path; so we strip the beginning                                                                                                                                               
    # and the end, to get the repo name as it is specified in gitolite conf                                                                                                                                        
    return unless $repo =~ s/^\Q$projectroot\E\/?(.+)\.git$/$1/;

    # check for (at least) "R" permission                                                                                                                                                                          
    my $ret = `/usr/local/bin/test_git_access_right $repo $user`;
    my $res = $ret !~ /DENIED/;
    return ($ret !~ /DENIED/);

and the test_git_access_right script:

su - git -c "gitolite access $*"

My problem is, that the test_git_acces_right script is not executed (tested by embedding an echo). So what am I doing wrong here?

Thanks in advance for any help!

share|improve this question
See my setup for gitweb and gitolite here: : the… is executed if found. I call from there… – VonC Dec 30 '12 at 21:52
Thanks. Actually I've already seen your setup but since I'm not really comfortable in perl I was hoping for an easier solution. I'll have another look. – Martin Schulze Dec 30 '12 at 21:54
Well... all GitWeb is in perl, so the plugin (which is expected by gitweb itself) which is gitweb_config.perl should call a perl script. – VonC Dec 30 '12 at 22:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.