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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 01, 2008 at 01:17:07AM +0100, Jakub Narebski wrote:
><snip> 
> Note that some of info is needed for 'projects_list' view, and some only
> for the 'summary' view.  For the 'projects_view' page we would want to
> avoid, I think, calling "git config -z -l" per repository (or opening
> $git_dir/config file and [limited] parsing it inside gitweb in Perl,
> like git-cvsserver does).  For 'summary' view we want usually to read
> repo config file for features nevertheless, and is only once per
> web-page, so we don't avoid it then.
> 
> Currently for 'projects_list' view we have, when $projects_list is
> a directory (this includes situation when it is undef, and fallbacks
> to $projectroot):
>  1. Call git-for-each-ref to get last modification time
>  2. Read $git_dir/description file for description (which is generated
>     by default template, so is usualy present, if in useless form),
>     fallback to git-config / reading $git_dir/config, gitweb.description
>  3. Check owner of $git_dir (stat + getpwuid)
> 
> With the addition of $git_dir/owner and gitweb.owner we would have
>  3'. Read $git_dir/owner file, usually not present,
>      fallback to gitweb.owner (which means reading and parsing
>      repo config!),
>      fallback to $git_dir owner (stat + getpwuid)
> so after consideration I think that adding gitweb.owner is a bit of
> a stupid idea from performance point of view, at least till we have
> 'projects_list' caching. Only $git_dir/owner would be better.

Unless we parse config only once for each project. We can create a small
cache with all gitweb conf. Then each time we ask
git_get_project_config('bla') we check if we alread had parsed it, if parsed
get in a small hash table.
We could even check if we are generating project list then we can store only
description and owner. (this sounds ugly)
>  
> BTW. what about filesystems where file / directory does not have
> an owner?

Does GIT runs on a system like this?! I only remembers FAT having such
"problem". 8^)
> 
> 
> Another solution would be using $projectroot/.gitconfig, with simplified
> syntax easy parseable by Perl, with gitweb.<repo path>.<config>, where
> <config> is limited to 'description', 'owner' and 'url', and 
> gitweb.description for fallback description, gitweb.owner for fallback
> owner and owner for set of repositories, gitweb.baseurl for base URLs
> (gitweb.<repo>.url = gitweb.baseurl/<repo>).

This sounds good.  Having this small, simple file would make things better.
But we will have another file inside repository, having all in config would
be cleaner [i guess]. If we parse config file only once per project might be
good.


> 
> This would limit repo paths to not have embedded newlines in them, but
> this is not I think serious limitation :-)
> 
> -- 
> Jakub Narebski
> Poland

-- 
Bruno Ribas - ribas@xxxxxxxxxxxx
http://web.inf.ufpr.br/ribas
C3SL: http://www.c3sl.ufpr.br 
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux