From mboxrd@z Thu Jan 1 00:00:00 1970 From: mackyle at gmail.com (Kyle J. McKay) Date: Thu, 16 Jan 2014 05:46:06 -0800 Subject: owner links? (was: author/committer/tagger links -- kernel.org?) In-Reply-To: References: <44979A07-365E-461B-90C4-11B3A23B2683@gmail.com> Message-ID: On Jan 16, 2014, at 03:18, Jason A. Donenfeld wrote: > On Thu, Jan 16, 2014 at 4:28 AM, Kyle J. McKay > wrote: >> Looking at the new docs for this [4] I don't see an option to >> filter owners. >> I see that the owner is passed in as "CGIT_REPO_OWNER", but I don't >> see an >> opportunity to produce the owner markup. Is it there and I'm just >> not >> seeing it? > > This is certainly interesting, though slightly different, as the > owners aren't attached to email authors, like in the commits. Still > though, something worth exploring. There are a number of options for > this. I could add a filter wrapper around the owner column values. Or, > I could implement the search capability directly in cgit. Or other > things. Here's the relevant change to gitweb on repo that supports this: # owner link hook given owner name (full and NOT obfuscated) # should return full URL-escaped link to attach to owner, for example: # sub { return "/showowner.cgi?owner=".CGI::Util::escape($_[0]); } our $owner_link_hook = undef; And we use this hook: $owner_link_hook = sub { url_path($Girocco::Config::webadmurl). "/projlist.cgi?name=".md5_hex($_[0]); }; > First, though -- is repo.or.cz considering moving to cgit from its > modified gitweb? Is this a serious investigation into cgit as a > replacement? Replacement's a strong word at this point. I've been looking into it ever since I found this in the Apache config: RewriteRule ^/c/(.*)$ /cgit.cgi?url=$1 [L,QSA] So a cgit version of the cgit mirror would be http://repo.or.cz/c/cgit.git (don't bother, 404 at this point). I do slip in the occasional preparatory work [1] to make cgit support easier when I become aware of such things. :) Looking at top, gitweb is clearly a CPU pig on repo.or.cz (git clones can also be piggy but I expect that to drop significantly when the new pack bitmap support is deployed). And besides, the cgit display just looks good. I'd like to add support for cgit to girocco [2] as an alternative to gitweb. When that's sufficiently mature I'd like to deploy it alongside gitweb on repo for a time and then we can talk about switching. :) >> The repo.or.cz pages also try to make the email addresses more >> difficult to >> scrape by generating peculiar markup (the HTML::Email::Obfuscate >> package) so >> conceivably this could be handled in the owner filter as well. > > We have the noplainemail config flag already. Perhaps this could be > phased out, preferring the email-filter and commit-filter instead. As you can see from the hook text above the repo gitweb hook only offers the ability to attach a link, it doesn't actually let one generate the markup or change the displayed owner name. That's all I really need. On the project list page [3] there are thousands of these, so running a shell script for each one is a non-starter. A simple regex is not good enough either because it needs to generate the md5 hash (probably ought to be md5_hex(lc($_[0])) too -- another TODO item). Kyle [1] http://repo.or.cz/w/girocco.git/commit/abe9554c1bf1699ac0aaea08639310f404458d14 [2] http://repo.or.cz/w/girocco.git/blob/HEAD:/README [3] http://repo.or.cz/w?a=project_list