git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Bruno Ribas <ribas@c3sl.ufpr.br>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: Use config file or file for repository owner's name.
Date: Tue, 29 Jan 2008 22:16:16 -0800	[thread overview]
Message-ID: <7vwsprj0sv.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1201670898-15076-1-git-send-email-ribas@c3sl.ufpr.br> (Bruno Ribas's message of "Wed, 30 Jan 2008 03:28:17 -0200")

Bruno Ribas <ribas@c3sl.ufpr.br> writes:

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

> +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");
>  	}

I am not sure about the effect of this change on a large scale
site.  If you do not have the project list file, originally we
just needed a stat per project, but now you open an extra file
(either "owner" or "config") and read it, once per every
project.

The project list page does that for every project, and it
actually is worse because it also needs to open yet another file
"description" from the directory.  It almost makes me wonder if
are much better of to have a single file per project to read all
the necessary information off of, instead of having to open many
little files (currently it is only two---owner and description.
But who knows what other little pieces of information you would
want to add next week).

  parent reply	other threads:[~2008-01-30  6:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Junio C Hamano [this message]
2008-01-31  2:36   ` [PATCH] gitweb: Use config file or file for repository owner's name 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vwsprj0sv.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ribas@c3sl.ufpr.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).