From: Jakub Narebski Date: Fri, 08 Feb 2008 10:55:33 GMT Subject: Re: [PATCH] gitweb: Use the config file to set repository owner's name. Message-ID: In-Reply-To: <1202445714-28971-2-git-send-email-ribas@c3sl.ufpr.br> Bruno Ribas writes: > Allow to use configuration variable gitweb.owner set the repository owner, > it checks the gitweb.owner, if not set it uses filesystem directory's owner. > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > index 8ef2735..e8a43b7 100755 > --- a/gitweb/gitweb.perl > +++ b/gitweb/gitweb.perl > @@ -1767,7 +1767,12 @@ sub git_get_project_owner { > if (exists $gitweb_project_owner->{$project}) { > $owner = $gitweb_project_owner->{$project}; > } > - if (!defined $owner) { > + > + if (!defined $owner){ > + $owner = git_get_project_config('owner'); > + } > + > + if (!$owner) { > $owner = get_file_owner("$projectroot/$project"); > } > First, I think the empty lines added are not needed. Second, git_get_project_config() subroutine _REQUIRES_ for $git_dir to be set. So you have to set $git_dir before checking repo config; then you can reuse $git_dir in checking file owner. -- Jakub Narebski Poland ShadeHawk on #git