]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Use the config file to set repository owner's name.
authorBruno Ribas <redacted>
Fri, 8 Feb 2008 16:38:04 +0000 (14:38 -0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:12 +0000 (00:07 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
README
gitweb.perl

diff --git a/README b/README
index 8ffca2e8378b0e73f24e40a45a106be449db331658e40c99b43dcebf13049a6d..0c7d7ea2ce25b43e8ecb5626aa47ecb8d84720a9feb75256dda97e67d14ce49f 100644 (file)
--- a/README
+++ b/README
@@ -232,6 +232,10 @@ You can use the following files in repository:
    Displayed in the project summary page. You can use multiple-valued
    gitweb.url repository configuration variable for that, but the file
    takes precendence.
+ * gitweb.owner
+   You can use the gitweb.owner repository configuration variable to set
+   repository's owner. It is displayed in the project list and summary
+   page. If it's not set, filesystem directory's owner is used.
  * various gitweb.* config variables (in config)
    Read description of %feature hash for detailed list, and some
    descriptions.
index 911ecd98cd59485f2d43ba8b0ad913ac4b23d440186aa0bbb1cd4d522a3b700f..5a5fb61c03422c8aabdb3ee836e2893aabbf856482e846854503a98cd39393eb 100755 (executable)
@@ -1760,6 +1760,7 @@ sub git_get_project_owner {
        my $owner;
 
        return undef unless $project;
+       $git_dir = "$projectroot/$project";
 
        if (!defined $gitweb_project_owner) {
                git_get_project_list_from_file();
@@ -1768,8 +1769,11 @@ sub git_get_project_owner {
        if (exists $gitweb_project_owner->{$project}) {
                $owner = $gitweb_project_owner->{$project};
        }
+       if (!defined $owner){
+               $owner = git_get_project_config('owner');
+       }
        if (!defined $owner) {
-               $owner = get_file_owner("$projectroot/$project");
+               $owner = get_file_owner("$git_dir");
        }
 
        return $owner;
This page took 0.302735 seconds and 4 git commands to generate.