develooper Front page | perl.perl5.porters | Postings from July 2009

Re: updated gitweb on

Thread Previous
July 27, 2009 13:19
Re: updated gitweb on
Message ID:
2009/7/27 demerphq <>:
> 2009/7/27 Craig A. Berry <>:
>> On Sun, Jul 26, 2009 at 5:21 PM, demerphq<> wrote:
>>> I updated gitweb today, and it seems like snapshots are now working.
>> Thanks for doing that.
>>> With one catch. No .patch file so it probably isnt possible to use the
>>> snapshot to build.
>> Well, you can build, but unless you wrote down the commit ID
>> somewhere, you won't know what you've bulit.
>>> I need to figure out a solution to that ASAP. But at least now its
>>> possible to get a .tgz.
>> We should probably document the exact incantation of git describe that
>> generates the .patch file, or perhaps embed it in a
>> and put it in the repository.  That way it's transparent where it
>> comes from and any mirror that wants to do the same thing could do so.
>>  I assume this is currently done in a shell script on dromedary
>> somewhere?
> On camel, in /gitcommon/branches you can find a README explaining what happens.

Im not sure if i should check in that README or the branches generator script.

However, I *did* just commit and push a quickie utility I wrote to
generate the .patch file.

Ive also looked into the gitweb.cgi script to add the .patch file. The
basic problem is we need to generate the tar output, then append the
.patch file, then compress it. Ive written the code to generate the
.patch file, now we just need to hack the cgi to do the appending. I
havent got that far but the relevent code for someone with more tuits
is this at line 5182 in our deployed version:

        my $cmd;
        $filename .= "-$hash$known_snapshot_formats{$format}{'suffix'}";
        $cmd = quote_command(
                git_cmd(), 'archive',
                "--prefix=$name/", $hash);
        if (exists $known_snapshot_formats{$format}{'compressor'}) {
                $cmd .= ' | ' .

        print $cgi->header(
                -type => $known_snapshot_formats{$format}{'type'},
                -content_disposition => 'inline; filename="' .
"$filename" . '"',
                -status => '200 OK');

        open my $fd, "-|", $cmd
                or die_error(500, "Execute git-archive failed");
        binmode STDOUT, ':raw';
        print <$fd>;
        binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi
        close $fd;

We need to change that to call tar --file... --append .patch
afterwards, and THEN compress it.

And yes I feel a bit guilty sending this to the list, but im tired
right now... :-)


perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About