From: Jakub Narebski <jnareb@gmail.com>
To: "Nagy Balázs" <js@iksz.hu>
Cc: Bruno Cesar Ribas <ribas@c3sl.ufpr.br>, git@vger.kernel.org
Subject: Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name
Date: Fri, 1 Feb 2008 14:18:57 +0100 [thread overview]
Message-ID: <200802011418.59862.jnareb@gmail.com> (raw)
In-Reply-To: <47A09ED2.6070407@iksz.hu>
On Wed, 30 Jan 2008, Nagy Balázs wrote:
> Jakub Narebski wrote:
>> Nagy Balázs wrote:
>>
>>> Are you talking about I/O of an all-in CGI script?
>>>
>>
>> I am talking there between I/O difference between situation
>> (configuration) when $projects_list is a directory (default),
>> or is a file. If $projects_list is a directory, gitweb scans
>> directory structure to find git repositories, which for large
>> number of repositories might take time, even with filesystem
>> cache, and with depth of searching bound by $project_maxdepth.
>> Add to that finding symbolic name of the owner of repository
>> directory, or (with the patch) reading a file per repo with repo
>> owner.
>>
> We have two configurable options here: $projectroot and $projects_list.
> If $projects_list is a directory, we'll end up using a directory to get
> project list info, and using another one to actually handle the
> projects. In small repo area it's safe to have $projects_list empty.
> This is why I reference $projects_list as a file.
Besides the fact that using $projects_list file can speed up generating
'projects_list' page, it can also be used to either just restrict
visibility of certain projects (some projects will be not visible
in the projects list page, but will be still available when provided
with project name), or restrict/refuse access (if GITWEB_STRICT_EXPORT
aka $strict_export is true, only files shown in projects list page
would be available to browse; it can be further restricted using
"export-ok" mechanism).
You can use $projects_list pointing to directory with symlinks to
selected repositories residing under $projectroot for that. So it
is not only $projects_list a file, or $projects_list undef (and fallback
to $projectroot and $projects_list as directory). $projects_list as
a directory different from $projectroot has sense in some cases too.
> If $projects_list is a file, we'll rely on a file which was generated
> some time ago and can't reflect the latest changes of $projectroot (but
> see below).
Creating projects is a rare event. You cannot do this remotely with git
tools only. So I think it would be not very difficult and not very
suprising to use some script to add new project, script which would
ensure proper project configuration, perhaps setup proper SSH keys, and
regenerate $projects_list file if it is what gitweb is using.
[...]
>>> What if this script creates the $projects_list file, for example when
>>> the $projectroot's mtime changes? We can even hold mtime info for every
>>> project's config file.
>>>
>>
>> I don't understand what you wanted to say here. $projects_list file
>> lists only project path (project name) and project owner.
>>
> I mean it would be better to add this kind of metadata like description
> and owner's shoesize to config instead of a raw file. I understand row
> files are easier to read but reading a single cache file adn doing some
> stat()s are much easier. I can think of $project_lists as a cache file
> name, which can be maintained by gitweb.cgi, and these mtime values
> could be saved to $project_list to verify entries' validity.
Err... I think that having some kind of cache for 'projects_list' page
is a separate issue than using $projects_list file for a list
(and owners) of projects.
Besides I'd rather opt for the other side of spectrum: instead of
gitweb checking for freshness of a 'cache', regenerate the cache
or just delete it when you know that contents change: from a script
adding a repository, from a script renaming or changing description
or an owner of repository, from a script deleting repository or
removing it from a list, from a post-update / post-receive hook if
the cached info includes last change, etc.
> All we have to do is to maintain $project_list to be up to date. The
> best would be to have a separate projectlist maintainer script which
> handles two scenarios:
>
> 1| repo addition/deletion
> 2| repo config changes
>
> I don't have solution for the first scenario which would be a speed
> improvement in gitweb.cgi, this is why I suggest to put $project_list
> updater to a separate script. The second scenario could be handled by
> gitweb.cgi though, but it would be mere code duplication.
I was thinking about gitconfig file, but with limited syntax to be
easily parseable from Perl, like git-cvsserver does, put in $projectroot,
e.g. $projectroot/gitconfig, which would contain parts of repo config
relevant to 'projects_list' page. It would use gitweb.<repo>.<key>
syntax, where <key> is one of owner, description, and perhaps url.
Or we could put it in gitweb_config.perl file, in the form of parsed
config hash... well, it should be fairly easy to combine those two
approaches with current code: use %config hash, and fill it from
$projectroot/gitconfig if not set.
Of course you would have the usual danger when dealing with data
duplication, naley that they would get out of sync. And usual danger
dealing with caches, that the validating needed and other system
caches would make it perform *worse* than without cache.
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2008-02-01 13:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2008-02-01 16:11 ` Nagy Balázs
2008-02-01 19:10 ` Robin Rosenberg
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=200802011418.59862.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=js@iksz.hu \
--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).