Re: [PATCH] gitweb.cgi: Customization
- From
- Matthias Lederhofer <matled@gmx.net>
- Date
- Aug 2, 2006, 17:13 UTC
- Message-ID
- <E1G8KHP-0004j5-4P@moooo.ath.cx>
- In-Reply-To
- <20060802165333.GA22726@coredump.intra.peff.net>
Jeff King <peff@peff.net> wrote:
Show 10 quoted lines
> On Wed, Aug 02, 2006 at 11:23:22AM -0500, Jon Loeliger wrote:
> Why don't we have sensible compile-time defaults that can be overridden
> by a run-time config file like every other sane program? For those who
> are opposed to the run-time config, they can simply not have a config
> file.
>
> See the (completely untested) patch below. Obviously the config file
> name has to be set at build time. However, since it is interpolated by
> perl, you can do clever things like:
> /etc/gitweb/$ENV{MY_VIRTUAL_HOST}.plI like this (it is quite similar to my suggestions :)).
Show 12 quoted lines
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -66,6 +66,9 @@ # file to use for guessing MIME types be
> # (relative to the current git repository)
> our $mimetypes_file = undef;
>
> +our $GITWEB_CONFIG = "@@GITWEB_CONFIG@@";
> +require $GITWEB_CONFIG if -e $GITWEB_CONFIG;
> +
> # input validation and dispatch
> our $action = $cgi->param('a');
> if (defined $action) {The only other thing to change is to move the mkdir($git_temp) and qx($GIT --version) below this line.