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

[PATCH] gitweb: Support for custom per-project owner string

From
Petr Baudis <pasky@suse.cz>
Date
Sep 19, 2006, 22:55 UTC
Message-ID
<20060919225522.GB13132@pasky.or.cz>

This adds very simple support for per-project setting of the owner string (in an environment where the actual owners won't have access to the repositories accessed by gitweb, so faking identity is not an issue).

There should be an option to disable this, but this is just a patch that someone might like (and/or pick up and polish), not intended for inclusion as it is.

Also, ideally this would be in the configfile but calling repoconfig for each repository in the index would slow things down way too much.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 gitweb/gitweb.perl |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 7ecd7df..d50bae5 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -818,6 +818,13 @@ sub git_get_project_owner {
 		}
 		close $fd;
 	}
+	if (!defined $owner and -f "$projectroot/$project/owner") {
+		if (open my $fd, "$projectroot/$project/owner") {
+			$owner = <$fd>;
+			chomp $owner;
+			close $fd;
+		}
+	}
 	if (!defined $owner) {
 		$owner = get_file_owner("$projectroot/$project");
 	}
@@ -2186,7 +2193,7 @@ sub git_project_list {
 			$pr->{'descr'} = chop_str($descr, 25, 5);
 		}
 		if (!defined $pr->{'owner'}) {
-			$pr->{'owner'} = get_file_owner("$projectroot/$pr->{'path'}") || "";
+			$pr->{'owner'} = git_get_project_owner($pr->{'path'}) || "";
 		}
 		push @projects, $pr;
 	}
@@ -2275,7 +2282,7 @@ sub git_project_index {
 
 	foreach my $pr (@projects) {
 		if (!exists $pr->{'owner'}) {
-			$pr->{'owner'} = get_file_owner("$projectroot/$project");
+			$pr->{'owner'} = git_get_project_owner($project);
 		}
 
 		my ($path, $owner) = ($pr->{'path'}, $pr->{'owner'});
Next: Jakub Narebski
Message 1 of 6 in “gitweb: Support for custom per-project owner string”
  1. gitweb: Support for custom per-project owner stringPetr Baudis, Sep 19, 2006
  2. Jakub NarebskiSep 19, 2006
  3. Petr BaudisSep 19, 2006
  4. Junio C HamanoSep 20, 2006
  5. Petr BaudisSep 20, 2006
  6. Jakub NarebskiSep 20, 2006

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.