Re: [PATCH] gitweb: snapshot cleanups & support for offering multiple formats
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 7, 2007, 20:52 UTC
- Message-ID
- <7vir8w6inf.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <1183053733.6108.0.camel@mattlaptop2>
Matt McCutchen <hashproduct@gmail.com> writes:
Show 31 quoted lines
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index dbfb044..f36428e 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -101,6 +101,15 @@ our $mimetypes_file = undef;
> # could be even 'utf-8' for the old behavior)
> our $fallback_encoding = 'latin1';
>
> +# information about snapshot formats that gitweb is capable of serving
> +# name => [mime type, filename suffix, --format for git-archive,
> +# compressor command suffix]
> +our %known_snapshot_formats = (
> + 'tgz' => ['application/x-gzip' , '.tar.gz' , 'tar', '| gzip' ],
> + 'tbz2' => ['application/x-bzip2', '.tar.bz2', 'tar', '| bzip2'],
> + 'zip' => ['application/zip' , '.zip' , 'zip', '' ],
> +);
> +
> # You define site-wide feature defaults here; override them with
> # $GITWEB_CONFIG as necessary.
> our %feature = (
> @@ -131,20 +140,22 @@ our %feature = (
> ...
> 'snapshot' => {
> 'sub' => \&feature_snapshot,
> 'override' => 0,
> - # => [content-encoding, suffix, program]
> - 'default' => ['x-gzip', 'gz', 'gzip']},
> + 'default' => ['tgz']},
>
> # Enable text search, which will list the commits which match author,
> # committer or commit text to a given string. Enabled by default.This is a very nice clean-up, and I agree we should go this route in the longer term.
This however will break people's existing gitweb configuration, so if we were to do this it should be post 1.5.3, I would say.