Subject: Re: [PATCHv5] Add Gitweb support for XZ compressed snapshots

From: Jakub Narebski <[email-masked]>
Date: Mon, 3 Aug 2009 01:25:51 +0200

On Sat, 1 Aug 2009, demerphq wrote:
> 2009/8/1 Jakub Narebski <[email-masked]>:
>> demerphq <[email-masked]> writes:
>>
>>> FWIW the perl project ripped out all the snapshot generation logic
>>> from gitweb, and replaced it with a tool that generates snapshots
>>> correctly for our requirements (if the build process needs additional
>>> files /currently/ git-archive does not support adding them), this
>>> includes a disk level cache for the snapshots since creating the tar,
>>> adding the additional files, then gziping is quite slow.
>>>
>>> If its interesting to people I can post it and the other changes here,
>>> although its not a "nice" change, as I literally ripped out the
>>> existing code.
>>
>> Do you mean gitweb serving http://perl5.git.perl.org/ ?
> 
> Yes. I updated it to a relatively recent version just the other week.

By the way, if you don't mind, how do you keep your changes on top
of changing target, i.e. on top of updating baseline to recent 
versions?

> 
>> Well, at least publish this version of gitweb somewhere (snapshot or
>> better git repository), and add it to the list of gitweb forks at
>> http://git.or.cz/gitwiki/Gitweb wiki page.
> 
> Sure, we have been discussing doing that recently.
> 
> I need to cleanup how I set up the repository for it tho.

O.K.

> 
> Also probably there are one or two patches that should be pushed back
> to you. 

What do those patches consist of?
 
>> Sidenote: snapshot support appeared, as far as I know, first at fork of
>> gitweb that had been used by XMMS2, but the snapshot was generated by
>> a separate snapshot.cgi script... written in Python.  (Now they use
>> stock (if old) gitweb, I think.)
> 
> Ah, I'm not generating it with a separate cgi script, I just replaced
> the call to git-archive to be a call to my own tool.

O.K.  

By the way, this is one of the only two places where we have to
use quote_command and 3-argument form of open, instead of list for of
magic open.  It is because of pipeline, piping git-archive output
into compressor.  The other such place is git_object, to redirect error
stream to /dev/null (to discard stderr).

I thought about replacing it by list form of open somewhat (you can
find it in git mailing list archive), but it is not easy.  And IPC::Run
is IMVHO a bit of overkill, especially for "minimal dependencies"
gitweb (perhaps for Git::Web?).

> 
>> P.S. Perhaps you or other Perl Mongers would be interested in creating
>> yet another git web interface, in Perl, but contrary to (current)
>> gitweb modular and using more of CPAN modules?  For example convert
>> SVN::Web or Insurrection (or other Perl module) from Subversion (or
>> other SCM) to Git (and rename it to Git::Web, or ???).
> 
> I think that there is some interest in doing that and likely over time
> there will be more. It has come up at least a few times in our
> discussion forums. I think you could easily make a public call for
> support on places like Perlmonks to get more action tho.

Thanks in advance.

> 
> A better git api toolset for perl would make things a lot easier.
> Especially an XS one.

Well, in the beginnings of Git.pm there was XS interface (to 
git-hash-object or git-cat-file), but it was dropped because it
used -fPIC, which is not portable enough for Git (this is not present
in perl/Git.pm history in git.git repository).  Git.pm was created
by Petr 'Pasky' Baudis, author of Cogito porcelain, and creator and
admin of repo.or.cz (and also creator of first Git homepage).  
But he is not a Perl hacker (correct me if I am wrong, Pasky); both
Cogito and repo.or.cz duct tape (under name of Girocco) are written
in bash, not in Perl.  Which can be seen for example by using 
Error::Simple in Git.pm...

Also I don't think that Pasky has time for maintaining Git.pm, 
nevermind modernizing it / adding new features.

There was another attempt to make Perl interface for Git, more 
object-oriented, by Lea Wiemann during GSoC 2008 project 'gitweb caching'.
You can see results in Lea repository at repo.or.cz[1], and also in 
git.kernel.org gitweb code[2].

[1]: http://repo.or.cz/w/git/gitweb-caching.git
[2]: http://git.kernel.org/?p=git/warthog9/gitweb.git
 
>>
>> P.P.S. Could you per chance post announcement of Git User's Survey 2009
>> on http://perl5.git.perl.org, just like it is done on http://repo.or.cz
>> and http://git.kernel.org?  TIA.
> 
> Sure.

Hmmm... I don't see "Git User's Survey 2009" announcement at 
http://perl5.git.perl.org/.  Neither at Planet Perl Iron Man, nor at
Perlsphere

-- 
Jakub Narebski

Git User's Survey 2009:
http://tinyurl.com/GitSurvey2009