Re: gitweb: Support for snapshots in gitweb
- From
Aneesh Kumar <aneesh.kumar@gmail.com>
- Date
- Aug 17, 2006, 07:48 UTC
- Message-ID
- <cc723f590608170048y44737ab3h497fb22db8605027@mail.gmail.com>
- In-Reply-To
- <7vhd0bu873.fsf@assigned-by-dhcp.cox.net>
On 8/17/06, Junio C Hamano <junkio@cox.net> wrote:
Show 26 quoted lines
> "Aneesh Kumar K.V" <aneesh.kumar@gmail.com> writes:
>
> > @@ -2097,6 +2102,23 @@ sub git_tree {
> > git_footer_html();
> > }
> >
> > +sub git_snapshot {
> > + if (!defined $hash) {
> > + $hash = git_get_head_hash($project);
> > + }
> > + print $cgi->header(-type=>'application/x-tar', -Content-Encoding=>'x-gzip',
> > + '-content-disposition' => "inline; filename=\"$project.tar.gz\"",
> > + -status=> '200 OK');
>
> These -Mixed-Case, '-sometimes-quoted', spaces sometimes around
> double-arrow sometimes missing, parameters bother me. Perhaps:
>
> print $cgi->header(-type => 'application/x-tar',
> -content-encoding => 'x-gzip',
> -content-disposition =>
> "inline; filename=\"$project.tar.gz\"",
> -status => '200 OK');
>
> RFC 2616 says that "gzip" content-coding is registered with
> IANA, so I do not think you need to say "x-gzip".
>Please feel free to change the code. Or if you want me to send another patch with the changes suggested i can do the same. Let me know.
Show 11 quoted lines
> > + open my $fd, "-|", "$GIT tar-tree $hash \'$project\' | gzip -c6" or die_error(undef, "Execute git-tar-tree failed."); > > I think this "6" is because somebody suggested to use the > default "6" instead of "9" in your original and the suggestion > was because "9" tends to be too expensive. > > But if we do not have a good, specific, reason to use "6" (as > opposed to, say, "5" or "7") and have "6" here only because we > happen to know "6" is the current gzip default, then probably we > are better off just letting gzip decide what compression level > to use without specifying it ourselves?
yes that is correct. I changed it because it was suggested.
-aneesh