git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Added sub get_owner_file which checks if there's a file with project owner name
@ 2008-01-29  3:36 Bruno Ribas
  2008-01-29 11:26 ` Jakub Narebski
  0 siblings, 1 reply; 12+ messages in thread
From: Bruno Ribas @ 2008-01-29  3:36 UTC (permalink / raw)
  To: git; +Cc: Bruno Ribas

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

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

end of thread, other threads:[~2008-02-01 20:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-29  3:36 [PATCH] Added sub get_owner_file which checks if there's a file with project owner name Bruno Ribas
2008-01-29 11:26 ` Jakub Narebski
2008-01-29 14:25   ` Bruno Cesar Ribas
2008-01-29 15:28     ` Jakub Narebski
2008-01-29 17:22       ` Bruno Cesar Ribas
2008-01-29 18:27         ` Jakub Narebski
2008-01-29 20:53       ` Nagy Balázs
2008-01-29 21:36         ` Jakub Narebski
2008-01-30 15:59           ` Nagy Balázs
2008-02-01 13:18             ` Jakub Narebski
2008-02-01 16:11               ` Nagy Balázs
2008-02-01 19:10                 ` Robin Rosenberg

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).