git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: Use config file or file for repository owner's name.
@ 2008-01-30  5:28 Bruno Ribas
  2008-01-30  5:28 ` [PATCH] gitweb: Update gitweb/README to include the new per-repository configuration Bruno Ribas
  2008-01-30  6:16 ` [PATCH] gitweb: Use config file or file for repository owner's name Junio C Hamano
  0 siblings, 2 replies; 16+ messages in thread
From: Bruno Ribas @ 2008-01-30  5:28 UTC (permalink / raw)
  To: git; +Cc: Bruno Ribas

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

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-02-07  4:13 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-30  5:28 [PATCH] gitweb: Use config file or file for repository owner's name Bruno Ribas
2008-01-30  5:28 ` [PATCH] gitweb: Update gitweb/README to include the new per-repository configuration Bruno Ribas
2008-01-30  6:16 ` [PATCH] gitweb: Use config file or file for repository owner's name Junio C Hamano
2008-01-31  2:36   ` Bruno Cesar Ribas
2008-01-31  2:48     ` Junio C Hamano
2008-01-31  3:02       ` Bruno Cesar Ribas
2008-01-31  3:06       ` Junio C Hamano
2008-01-31  3:36         ` Jakub Narebski
2008-01-31 11:12           ` Johannes Schindelin
2008-02-01  0:17             ` Jakub Narebski
2008-02-04 13:35               ` Bruno Cesar Ribas
2008-02-04 14:00                 ` Jakub Narebski
2008-02-05  4:41         ` Bruno Cesar Ribas
2008-02-05 10:04           ` Jakub Narebski
2008-02-05 14:28             ` Bruno Cesar Ribas
2008-02-07  4:12           ` Bruno Cesar Ribas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).