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

[PATCH] Added sub get_owner_file which checks if there's a file with project owner name

From
BRBruno Ribas <ribas@c3sl.ufpr.br>
Date
Jan 29, 2008, 03:36 UTC
Message-ID
<1201577766-11601-1-git-send-email-ribas@c3sl.ufpr.br>

This file ($projectroot/$project/owner) is good to have when we don't want to maintain a project list AND when we share same SSH account for all projects, using ssh_acl for example.

Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br>
---
 gitweb/gitweb.perl |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 6256641..fac5f78 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1754,6 +1754,15 @@ sub git_get_project_list_from_file {
 	}
 }
 
+sub get_owner_file {
+    my $owner_file = shift;
+
+	open my $fd, "$owner_file" or return undef;
+	my $owner = <$fd>;
+	close $fd;
+	return to_utf8($owner);
+}
+
 sub git_get_project_owner {
 	my $project = shift;
 	my $owner;
@@ -1767,6 +1776,11 @@ sub git_get_project_owner {
 	if (exists $gitweb_project_owner->{$project}) {
 		$owner = $gitweb_project_owner->{$project};
 	}
+
+    if ( -f "$projectroot/$project/owner" ) {
+        $owner = get_owner_file("$projectroot/$project/owner");
+    }
+
 	if (!defined $owner) {
 		$owner = get_file_owner("$projectroot/$project");
 	}
-- 
1.5.3.8
Next: Jakub Narebski
Message 1 of 12 in “Added sub get_owner_file which checks if there's a file with project owner name”
  1. Added sub get_owner_file which checks if there's a file with project owner nameBruno Ribas, Jan 29, 2008
  2. Jakub NarebskiJan 29, 2008
  3. Bruno Cesar RibasJan 29, 2008
  4. Jakub NarebskiJan 29, 2008
  5. Bruno Cesar RibasJan 29, 2008
  6. Jakub NarebskiJan 29, 2008
  7. Nagy BalázsJan 29, 2008
  8. Jakub NarebskiJan 29, 2008
  9. Nagy BalázsJan 30, 2008
  10. Jakub NarebskiFeb 1, 2008
  11. Nagy BalázsFeb 1, 2008
  12. Robin RosenbergFeb 1, 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.