git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: gitweb: Support for snapshots in gitweb

From
Junio C Hamano <junkio@cox.net>
Date
Aug 17, 2006, 07:34 UTC
Message-ID
<7vhd0bu873.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<44E40CB1.7040805@gmail.com>
"Aneesh Kumar K.V" <aneesh.kumar@gmail.com> writes:
Show 11 quoted lines
> @@ -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".

> +	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?

Previous: Aneesh Kumar K.VNext: Aneesh Kumar
Message 9 of 13 in “gitweb / cg-export”
  1. Toby WhiteAug 16, 2006
  2. Toby WhiteAug 16, 2006
  3. Jakub NarebskiAug 16, 2006
  4. Aneesh Kumar K.VAug 16, 2006
  5. Aneesh Kumar K.VAug 16, 2006
  6. Fredrik KuivinenAug 16, 2006
  7. Junio C HamanoAug 16, 2006
  8. gitweb: Support for snapshots in gitwebAneesh Kumar K.V, Aug 17, 2006
  9. Junio C HamanoAug 17, 2006
  10. Aneesh KumarAug 17, 2006
  11. Jakub NarebskiAug 17, 2006
  12. Martin WaitzAug 16, 2006
  13. Kay SieversAug 16, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.