Re: [PATCH] gitweb: snapshot cleanups & support for offering multiple formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matt McCutchen <hashproduct@xxxxxxxxx> writes:

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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux