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

Re: updated gitweb on http://perl5.git.perl.org/perl.git

Thread Previous
From:
demerphq
Date:
July 27, 2009 13:19
Subject:
Re: updated gitweb on http://perl5.git.perl.org/perl.git
Message ID:
9b18b3110907271319r5b17b39en3772a251c068c6e1@mail.gmail.com
2009/7/27 demerphq <demerphq@gmail.com>:
> 2009/7/27 Craig A. Berry <craig.a.berry@gmail.com>:
>> On Sun, Jul 26, 2009 at 5:21 PM, demerphq<demerphq@gmail.com> 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 make_dot_patch.pl
>> 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',
                "--format=$known_snapshot_formats{$format}{'format'}",
                "--prefix=$name/", $hash);
        if (exists $known_snapshot_formats{$format}{'compressor'}) {
                $cmd .= ' | ' .
quote_command(@{$known_snapshot_formats{$format}{'compressor'}});
        }

        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... :-)

cheers,
Yves

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

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About