@matheusbsbs / matheus-bagliano / commits / b59012ef4e
Fork 0

gitweb: Use the config file to set repository owner's name.

Now gitweb checks if gitweb.owner exists before trying to get filesystem's owner. 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. Useful when we don't want to maintain project list file, and all repository directories have to have the same owner (for example when the same SSH account is shared for all projects, using ssh_acl to control access instead). Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Bruno Ribas committed Feb 8, 2008 at 14:38 UTC b59012ef4e7dde1895d988736c7df64f68b1e940
2 files changed +9 -1
gitweb/README
+4
@@ -233,6 +233,10 @@ You can use the following files in repository:
233 Displayed in the project summary page. You can use multiple-valued
234 gitweb.url repository configuration variable for that, but the file
235 takes precendence.
236 + * gitweb.owner
237 + You can use the gitweb.owner repository configuration variable to set
238 + repository's owner. It is displayed in the project list and summary
239 + page. If it's not set, filesystem directory's owner is used.
240 * various gitweb.* config variables (in config)
241 Read description of %feature hash for detailed list, and some
242 descriptions.
gitweb/gitweb.perl
+5 -1
@@ -1759,6 +1759,7 @@ sub git_get_project_owner {
1759 my $owner;
1760
1761 return undef unless $project;
1762 + $git_dir = "$projectroot/$project";
1763
1764 if (!defined $gitweb_project_owner) {
1765 git_get_project_list_from_file();
@@ -1767,8 +1768,11 @@ sub git_get_project_owner {
1768 if (exists $gitweb_project_owner->{$project}) {
1769 $owner = $gitweb_project_owner->{$project};
1770 }
1771 + if (!defined $owner){
1772 + $owner = git_get_project_config('owner');
1773 + }
1774 if (!defined $owner) {
1771 - $owner = get_file_owner("$projectroot/$project");
1775 + $owner = get_file_owner("$git_dir");
1776 }
1777
1778 return $owner;