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

Re: [PATCH] gitweb: Use config file or file for repository owner's name.

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 30, 2008, 06:16 UTC
Message-ID
<7vwsprj0sv.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1201670898-15076-1-git-send-email-ribas@c3sl.ufpr.br>
Bruno Ribas <ribas@c3sl.ufpr.br> writes:
Show 8 quoted lines
> 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).
Show 28 quoted lines
> +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).

Previous: Bruno RibasNext: Bruno Cesar Ribas
Message 3 of 16 in “gitweb: Use config file or file for repository owner's name.”
  1. gitweb: Use config file or file for repository owner's name.Bruno Ribas, Jan 30, 2008
  2. gitweb: Update gitweb/README to include the new per-repository configurationBruno Ribas, Jan 30, 2008
  3. Junio C HamanoJan 30, 2008
  4. Bruno Cesar RibasJan 31, 2008
  5. Junio C HamanoJan 31, 2008
  6. Bruno Cesar RibasJan 31, 2008
  7. Junio C HamanoJan 31, 2008
  8. Jakub NarebskiJan 31, 2008
  9. Johannes SchindelinJan 31, 2008
  10. Jakub NarebskiFeb 1, 2008
  11. Bruno Cesar RibasFeb 4, 2008
  12. Jakub NarebskiFeb 4, 2008
  13. Bruno Cesar RibasFeb 5, 2008
  14. Jakub NarebskiFeb 5, 2008
  15. Bruno Cesar RibasFeb 5, 2008
  16. Bruno Cesar RibasFeb 7, 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.