git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb: Use config file or file for repository owner's name.

From
BRBruno Ribas <ribas@c3sl.ufpr.br>
Date
Jan 30, 2008, 05:28 UTC
Message-ID
<1201670898-15076-1-git-send-email-ribas@c3sl.ufpr.br>

Allow to use configuration variable gitweb.owner or $GIT_DIR/owner file to set the repository owner, it checks $GIT_DIR/owner first, then falls back to the gitweb.owner, if none exist 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>
---
 gitweb/gitweb.perl |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 6256641..e29ad0a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1754,6 +1754,20 @@ sub git_get_project_list_from_file {
 	}
 }
 
+sub gitweb_get_project_owner {
+	my $path = shift;
+
+	$git_dir = "$projectroot/$path";
+	open my $fd, "$projectroot/$path/owner"
+		or return git_get_project_config('owner');
+	my $owner = <$fd>;
+	close $fd;
+	if (defined $owner) {
+		chomp $owner;
+	}
+	return $owner;
+}
+
 sub git_get_project_owner {
 	my $project = shift;
 	my $owner;
@@ -1767,6 +1781,10 @@ sub git_get_project_owner {
 	if (exists $gitweb_project_owner->{$project}) {
 		$owner = $gitweb_project_owner->{$project};
 	}
+
+    if (!defined $owner) {
+        $owner = gitweb_get_project_owner($project);
+    }
 	if (!defined $owner) {
 		$owner = get_file_owner("$projectroot/$project");
 	}
-- 
1.5.3.8
Next: Bruno Ribas
Message 1 of 16 in “gitweb: Use config file or file for repository owner's name.”
  1. gitweb: Use config file or file for repository owner's name.Bruno Ribas, Jan 30, 2008
  2. gitweb: Update gitweb/README to include the new per-repository configurationBruno Ribas, Jan 30, 2008
  3. Junio C HamanoJan 30, 2008
  4. Bruno Cesar RibasJan 31, 2008
  5. Junio C HamanoJan 31, 2008
  6. Bruno Cesar RibasJan 31, 2008
  7. Junio C HamanoJan 31, 2008
  8. Jakub NarebskiJan 31, 2008
  9. Johannes SchindelinJan 31, 2008
  10. Jakub NarebskiFeb 1, 2008
  11. Bruno Cesar RibasFeb 4, 2008
  12. Jakub NarebskiFeb 4, 2008
  13. Bruno Cesar RibasFeb 5, 2008
  14. Jakub NarebskiFeb 5, 2008
  15. Bruno Cesar RibasFeb 5, 2008
  16. Bruno Cesar RibasFeb 7, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.