{"thread":{"id":"5073","subject":"[PATCH] gitweb.cgi: Customization","startedAt":"2006-08-01T21:19:48Z","lastAt":"2006-08-03T16:24:27Z","messageCount":22,"participants":["Luben Tuikov","Junio C Hamano","Martin Langhoff","Matthias Lederhofer","Jon Loeliger","Jeff King","Jakub Narebski","Martin Waitz"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"24526","messageId":"20060801211948.99497.qmail@web31804.mail.mud.yahoo.com","threadId":"5073","inReplyTo":null,"subject":"[PATCH] gitweb.cgi: Customization","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-01T21:19:48Z","receivedAt":"2006-08-01T21:19:48Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"The file \"Gitweb_customization.pm\" now holds customizable\nvariables used by \"gitweb.cgi\".  It is read by \"gitweb.cgi\"\nfrom @INC, which includes \".\", at compile time.\n\nCopy \"Gitweb_customization.pm\" to where your \"gitweb.cgi\" or\nits link lives.  The values therein are default values,\nplease change them as per your setup.  From then on, you\nonly need to update (copy) \"gitweb.cgi\" in order to upgrade\nit, without editing or patching \"gitweb.cgi\" itself.\n\nSigned-off-by: Luben Tuikov <ltuikov@yahoo.com>\n---\n gitweb/Gitweb_customization.pm |   43 ++++++++++++++++++++++++++++++++++++++++\n gitweb/gitweb.cgi              |   31 +----------------------------\n 2 files changed, 44 insertions(+), 30 deletions(-)\n\ndiff --git a/gitweb/Gitweb_customization.pm b/gitweb/Gitweb_customization.pm\nnew file mode 100644\nindex 0000000..8bfa19a\n--- /dev/null\n+++ b/gitweb/Gitweb_customization.pm\n@@ -0,0 +1,43 @@\n+package    Gitweb_customization;\n+require    Exporter;\n+\n+our @ISA = qw(Exporter);\n+our @EXPORT = qw($GIT $projectroot $projects_list $home_text $site_name\n+\t\t $stylesheet $default_blob_plain_mimetype\n+\t\t $default_text_plain_charset $mimetypes_file);\n+\n+# core git executable to use\n+# this can just be \"git\" if your webserver has a sensible PATH\n+our $GIT = \"/usr/bin/git\";\n+\n+# absolute fs-path which will be prepended to the project path\n+our $projectroot = \"/pub/git\";\n+\n+# source of projects list\n+# Directory format:\n+#our $projects_list = $projectroot;\n+# File (shown below) each line in the file is:\n+#        [directory.git]<space>[owner.name]\n+# (ignore leading whitespace and perl comment char),\n+#   where [owner.name] is a sequence of chars with '+' for a space.\n+our $projects_list = \"index/index.aux\";\n+\n+# html text to include at home page\n+our $home_text = \"indextext.html\";\n+\n+# name of your site or organization to appear in page titles\n+# replace this with something more descriptive for clearer bookmarks\n+our $site_name = $ENV{'SERVER_NAME'} || \"Untitled\";\n+\n+# URI of default stylesheet\n+our $stylesheet = \"gitweb.css\";\n+\n+# default blob_plain mimetype and default charset for text/plain blob\n+our $default_blob_plain_mimetype = 'text/plain';\n+our $default_text_plain_charset  = undef;\n+\n+# file to use for guessing MIME types before trying /etc/mime.types\n+# (relative to the current git repository)\n+our $mimetypes_file = undef;\n+\n+1;\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex 9448b72..5251fac 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -15,6 +15,7 @@ use CGI::Carp qw(fatalsToBrowser);\n use Encode;\n use Fcntl ':mode';\n use File::Find qw();\n+use Gitweb_customization;\n binmode STDOUT, ':utf8';\n \n our $cgi = new CGI;\n@@ -23,14 +24,6 @@ our $my_url = $cgi->url();\n our $my_uri = $cgi->url(-absolute => 1);\n our $rss_link = \"\";\n \n-# core git executable to use\n-# this can just be \"git\" if your webserver has a sensible PATH\n-our $GIT = \"/usr/bin/git\";\n-\n-# absolute fs-path which will be prepended to the project path\n-#our $projectroot = \"/pub/scm\";\n-our $projectroot = \"/home/kay/public_html/pub/scm\";\n-\n # version of the core git binary\n our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : \"unknown\";\n \n@@ -43,28 +36,6 @@ if (! -d $git_temp) {\n # target of the home link on top of all pages\n our $home_link = $my_uri;\n \n-# name of your site or organization to appear in page titles\n-# replace this with something more descriptive for clearer bookmarks\n-our $site_name = $ENV{'SERVER_NAME'} || \"Untitled\";\n-\n-# html text to include at home page\n-our $home_text = \"indextext.html\";\n-\n-# URI of default stylesheet\n-our $stylesheet = \"gitweb.css\";\n-\n-# source of projects list\n-#our $projects_list = $projectroot;\n-our $projects_list = \"index/index.aux\";\n-\n-# default blob_plain mimetype and default charset for text/plain blob\n-our $default_blob_plain_mimetype = 'text/plain';\n-our $default_text_plain_charset  = undef;\n-\n-# file to use for guessing MIME types before trying /etc/mime.types\n-# (relative to the current git repository)\n-our $mimetypes_file = undef;\n-\n # input validation and dispatch\n our $action = $cgi->param('a');\n if (defined $action) {\n-- \n1.4.2.rc2.gd2da4\n"},{"id":"24527","messageId":"7vfygg14sq.fsf@assigned-by-dhcp.cox.net","threadId":"5073","inReplyTo":"20060801211948.99497.qmail@web31804.mail.mud.yahoo.com","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-01T22:15:17Z","receivedAt":"2006-08-01T22:15:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luben Tuikov <ltuikov@yahoo.com> writes:\n\n> Copy \"Gitweb_customization.pm\" to where your \"gitweb.cgi\" or\n> its link lives.\n\nI do not think this is a good idea -- there may not be any harm\ndone when http://site/cgi-bin/Gitweb_customization.pm is\naccessed, but this _does_ pollute the cgi-bin/ namespace.\n"},{"id":"24528","messageId":"20060801225352.26998.qmail@web31801.mail.mud.yahoo.com","threadId":"5073","inReplyTo":"7vfygg14sq.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-01T22:53:52Z","receivedAt":"2006-08-01T22:53:52Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <junkio@cox.net> wrote:\n> Luben Tuikov <ltuikov@yahoo.com> writes:\n> \n> > Copy \"Gitweb_customization.pm\" to where your \"gitweb.cgi\" or\n> > its link lives.\n> \n> I do not think this is a good idea -- there may not be any harm\n> done when http://site/cgi-bin/Gitweb_customization.pm is\n> accessed, but this _does_ pollute the cgi-bin/ namespace.\n\nAs does \"gitweb.css\".  Similarly, \"gitweb.css\"'s contents\nused to live in \"gitweb.cgi\" itself.\n\n\"Gitweb_customization.pm\" doesn't necessarily need to live\nin \"http://site/cgi-bin/\", but anywhere in any path\nin @INC, i.e. such that it wouldn't be accessible from\nthe outside world.\n\nThis method of customization seemed the least intrusive\nand easiest from re-deployment point of view.\n\n    Luben\n"},{"id":"24530","messageId":"7v8xm8xbaa.fsf@assigned-by-dhcp.cox.net","threadId":"5073","inReplyTo":"20060801225352.26998.qmail@web31801.mail.mud.yahoo.com","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-01T23:54:05Z","receivedAt":"2006-08-01T23:54:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luben Tuikov <ltuikov@yahoo.com> writes:\n\n> As does \"gitweb.css\".  Similarly, \"gitweb.css\"'s contents\n> used to live in \"gitweb.cgi\" itself.\n\nNot convincing argument.  gitweb.css, and git-logo.png patch I\nthink I will take, are meant to be fed to the http clients.\nThey do not compare with the customization.pm which is not.\n\nIn any case, I think tweaking gitweb.cgi from Makefile like\nMartin Waitz did is as easy and clean for people who want to\ncustomize; it should just be the matter of defining the\nnecessary params in config.mak.\n\nI do not think there is much difference between any of the\ncustomization proposed so far (yours, Martin's and the one from\nMatthias Lederhofer) from functionality and ease-of-use point of\nview.  They all try to make customization can be done in one\nplace, and the difference is mostly of taste, so I'd just pick\none from Martin.\n"},{"id":"24544","messageId":"20060802020114.99508.qmail@web31807.mail.mud.yahoo.com","threadId":"5073","inReplyTo":"7v8xm8xbaa.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-02T02:01:14Z","receivedAt":"2006-08-02T02:01:14Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <junkio@cox.net> wrote:\n> I do not think there is much difference between any of the\n> customization proposed so far (yours, Martin's and the one from\n> Matthias Lederhofer) from functionality and ease-of-use point of\n> view.  They all try to make customization can be done in one\n> place, and the difference is mostly of taste, so I'd just pick\n> one from Martin.\n\nOk, sounds good.\n\n    Luben\n"},{"id":"24545","messageId":"46a038f90608011913t777cf20dh9baaf355b19d18e6@mail.gmail.com","threadId":"5073","inReplyTo":"7v8xm8xbaa.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-08-02T02:13:51Z","receivedAt":"2006-08-02T02:13:51Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 8/2/06, Junio C Hamano <junkio@cox.net> wrote:\n> I do not think there is much difference between any of the\n> customization proposed so far (yours, Martin's and the one from\n> Matthias Lederhofer) from functionality and ease-of-use point of\n> view.  They all try to make customization can be done in one\n> place, and the difference is mostly of taste, so I'd just pick\n> one from Martin\n\nI'm a bit lost as to gitweb config. Are we not relying on %ENV for\nthis stuff? Apache's facilities to configure CGIs via ENV are really\npowerful. You can do conditionals in apache config files, lock stuff\ndown in httpd.conf, override it with files in conf.d, and\nallow/disallow overrides in .htaccess ...\n\ncheers,\n\n\nmartin\n"},{"id":"24546","messageId":"E1G8ArX-0006r2-6D@moooo.ath.cx","threadId":"5073","inReplyTo":"7v8xm8xbaa.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-08-02T07:09:51Z","receivedAt":"2006-08-02T07:09:51Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> In any case, I think tweaking gitweb.cgi from Makefile like\n> Martin Waitz did is as easy and clean for people who want to\n> customize; it should just be the matter of defining the\n> necessary params in config.mak.\nAck.\n\n> I do not think there is much difference between any of the\n> customization proposed so far (yours, Martin's and the one from\n> Matthias Lederhofer) from functionality and ease-of-use point of\n> view.  They all try to make customization can be done in one\n> place, and the difference is mostly of taste, so I'd just pick\n> one from Martin.\nFunctionality is a bit different.  If you have a configuration where\nperl is used this cannot be done using the make variables.  I would like\nto have the option to include a perl file (this does not conflict with\nusing the Makefile to fill in some values), I've explained this in my\nother patch.  The ways I see to specify the file to include are an\nenvironment variable (I don't know if all webservers make it easy to set\none), files after __DATA__ or just $include_file =\n@@GITWEB_INCLUDE_FILE@@ which is replaced by the filename or undef if\nthe user did not set this variable.  For the .pm thing I don't know if\nit is not too complicated to change the path I can put the file and just\nallowing the user to specify the full path is probably the best.  (I\nthink the $include_file way is probably the one to use, using __DATA__\nis a bit obscur, and not everyone can set environment variables for the\nwebserver.)\n"},{"id":"24548","messageId":"7v1wrzwpg5.fsf@assigned-by-dhcp.cox.net","threadId":"5073","inReplyTo":"46a038f90608011913t777cf20dh9baaf355b19d18e6@mail.gmail.com","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-02T07:45:46Z","receivedAt":"2006-08-02T07:45:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Martin Langhoff\" <martin.langhoff@gmail.com> writes:\n\n> I'm a bit lost as to gitweb config. Are we not relying on %ENV for\n> this stuff?\n\nIt is Ok to use %ENV as an alternative way, but I'd rather not\nmake it the _only_ way for basic configuration.  Not everybody\nruns Apache.\n"},{"id":"24551","messageId":"46a038f90608020059w2d4567ve2043f2c7467dea3@mail.gmail.com","threadId":"5073","inReplyTo":"7v1wrzwpg5.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-08-02T07:59:16Z","receivedAt":"2006-08-02T07:59:16Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 8/2/06, Junio C Hamano <junkio@cox.net> wrote:\n> \"Martin Langhoff\" <martin.langhoff@gmail.com> writes:\n>\n> > I'm a bit lost as to gitweb config. Are we not relying on %ENV for\n> > this stuff?\n>\n> It is Ok to use %ENV as an alternative way, but I'd rather not\n> make it the _only_ way for basic configuration.  Not everybody\n> runs Apache.\n\nHo-hum. And are those other webservers limited in their ENV-setting-fu? ;-)\n\nI always thought that any webserver implementing CGI had reasonable\nmeans of ENV manipulation, as that's the main mechanism for the\nwebserver to \"configure\" the CGI program.\n\nBut I'm definitely old-style and out-of-fashion in this.\n\n\n\nmartin\n"},{"id":"24554","messageId":"E1G8CUz-0002KI-VW@moooo.ath.cx","threadId":"5073","inReplyTo":"E1G8ArX-0006r2-6D@moooo.ath.cx","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-08-02T08:54:41Z","receivedAt":"2006-08-02T08:54:41Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Just another idea: add something like @@FOO@@ on a line of its own and\nthis is replaced by the content of a file if the user specifies one,\nnothing if he does not.  This way one could include the config\ndirectly into gitweb.cgi or include a file that includes the\nconfiguration file from another place.\n"},{"id":"24555","messageId":"46a038f90608020231l37de81f0i5f14c7c264fc40bd@mail.gmail.com","threadId":"5073","inReplyTo":"E1G8CUz-0002KI-VW@moooo.ath.cx","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-08-02T09:31:17Z","receivedAt":"2006-08-02T09:31:17Z","isPatch":true,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 8/2/06, Matthias Lederhofer <matled@gmx.net> wrote:\n> Just another idea: add something like @@FOO@@ on a line of its own and\n\nWe kind-of had that in a few Perl scripts before, and it's a mighty\npain to develop and debug from your git repo because it makes your\nchecked-in code invalid.\n\nYou might want to see this patch:\nhttp://kernel.org/git/?p=git/git.git;a=commitdiff;h=e923effb43fa952f9cb72ffe4c3625fce7655bff;hp=ced9456a27197fc038fbc5b5ebad87e55f1920d2\n\ncheers,\n\n\n\nm\n"},{"id":"24559","messageId":"E1G8GFd-00036i-6y@moooo.ath.cx","threadId":"5073","inReplyTo":"46a038f90608020231l37de81f0i5f14c7c264fc40bd@mail.gmail.com","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-08-02T12:55:05Z","receivedAt":"2006-08-02T12:55:05Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Martin Langhoff <martin.langhoff@gmail.com> wrote:\n> On 8/2/06, Matthias Lederhofer <matled@gmx.net> wrote:\n> >Just another idea: add something like @@FOO@@ on a line of its own and\n> \n> We kind-of had that in a few Perl scripts before, and it's a mighty\n> pain to develop and debug from your git repo because it makes your\n> checked-in code invalid.\n> \n> You might want to see this patch:\n> http://kernel.org/git/?p=git/git.git;a=commitdiff;h=e923effb43fa952f9cb72ffe4c3625fce7655bff;hp=ced9456a27197fc038fbc5b5ebad87e55f1920d2\nPerhaps # @@INSERT_YOUR_CODE_HERE@@?\n"},{"id":"24564","messageId":"E1G8J22-0001MP-N2@moooo.ath.cx","threadId":"5073","inReplyTo":"46a038f90608020059w2d4567ve2043f2c7467dea3@mail.gmail.com","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-08-02T15:53:14Z","receivedAt":"2006-08-02T15:53:14Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Martin Langhoff <martin.langhoff@gmail.com> wrote:\n> On 8/2/06, Junio C Hamano <junkio@cox.net> wrote:\n> >\"Martin Langhoff\" <martin.langhoff@gmail.com> writes:\n> >\n> >> I'm a bit lost as to gitweb config. Are we not relying on %ENV for\n> >> this stuff?\n> >\n> >It is Ok to use %ENV as an alternative way, but I'd rather not\n> >make it the _only_ way for basic configuration.  Not everybody\n> >runs Apache.\n> \n> Ho-hum. And are those other webservers limited in their ENV-setting-fu? ;-)\n> \n> I always thought that any webserver implementing CGI had reasonable\n> means of ENV manipulation, as that's the main mechanism for the\n> webserver to \"configure\" the CGI program.\n> \n> But I'm definitely old-style and out-of-fashion in this.\nAt least if you cannot change the webserver configuration it might be\nmore complicated to set environment variables.\n"},{"id":"24566","messageId":"1154535801.19994.15.camel@cashmere.sps.mot.com","threadId":"5073","inReplyTo":"7v8xm8xbaa.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2006-08-02T16:23:22Z","receivedAt":"2006-08-02T16:23:22Z","isPatch":true,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"On Tue, 2006-08-01 at 18:54, Junio C Hamano wrote:\n\n> In any case, I think tweaking gitweb.cgi from Makefile like\n> Martin Waitz did is as easy and clean for people who want to\n> customize; it should just be the matter of defining the\n> necessary params in config.mak.\n\nI disagree.  I run multiple virtual web servers on one\nphysical machine.  Several of them run different gitweb\ninstances, each with different configurations.\n\nWith this \"params in config.mk\" approach, I have to\nrun it multiple times, once for each web server I run.\n\nI _really_ would prefer an \"include from .\" feature\nwhere I can place the specific gitweb_config.pm parts\nin the same directory where gitweb.{pl,cgi} is installed.\n\nWe really need to separate out these config values\nfrom the gitweb.{pl,cgi} script itself.  We _need_ to\nbe able to update the gitweb script independently,\nand easily.\n\n> I do not think there is much difference between any of the\n> customization proposed so far (yours, Martin's and the one from\n> Matthias Lederhofer) from functionality and ease-of-use point of\n> view.  They all try to make customization can be done in one\n> place, and the difference is mostly of taste, so I'd just pick\n> one from Martin.\n\nLet's just make sure it is a separate config file, please.\n\nI posted a patch to this end back on March 22 or 23 or so\nas well.\n\nThanks,\njdl\n"},{"id":"24570","messageId":"20060802165333.GA22726@coredump.intra.peff.net","threadId":"5073","inReplyTo":"1154535801.19994.15.camel@cashmere.sps.mot.com","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2006-08-02T16:53:33Z","receivedAt":"2006-08-02T16:53:33Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 02, 2006 at 11:23:22AM -0500, Jon Loeliger wrote:\n\n> With this \"params in config.mk\" approach, I have to\n> run it multiple times, once for each web server I run.\n>\n> I _really_ would prefer an \"include from .\" feature\n> where I can place the specific gitweb_config.pm parts\n> in the same directory where gitweb.{pl,cgi} is installed.\n\nWhy don't we have sensible compile-time defaults that can be overridden\nby a run-time config file like every other sane program? For those who\nare opposed to the run-time config, they can simply not have a config\nfile.\n\nSee the (completely untested) patch below. Obviously the config file\nname has to be set at build time. However, since it is interpolated by\nperl, you can do clever things like:\n  /etc/gitweb/$ENV{MY_VIRTUAL_HOST}.pl\n\n-Peff\n\n---\n Makefile           |    2 ++\n gitweb/gitweb.perl |    3 +++\n 2 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2562a2c..170d082 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -127,6 +127,7 @@ GIT_PYTHON_DIR = $(prefix)/share/git-cor\n # DESTDIR=\n \n # default configuration for gitweb\n+GITWEB_CONFIG = gitweb_config.perl\n GITWEB_SITENAME =\n GITWEB_PROJECTROOT = /pub/git\n GITWEB_LIST =\n@@ -629,6 +630,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl\n \tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n \t    -e 's|@@GIT_VERSION@@|$(GIT_VERSION)|g' \\\n \t    -e 's|@@GIT_BINDIR@@|$(bindir)|g' \\\n+\t    -e 's|@@GITWEB_CONFIG@@|$(GITWEB_CONFIG)|g' \\\n \t    -e 's|@@GITWEB_SITENAME@@|$(GITWEB_SITENAME)|g' \\\n \t    -e 's|@@GITWEB_PROJECTROOT@@|$(GITWEB_PROJECTROOT)|g' \\\n \t    -e 's|@@GITWEB_LIST@@|$(GITWEB_LIST)|g' \\\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 1db1414..cc33d97 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -66,6 +66,9 @@ # file to use for guessing MIME types be\n # (relative to the current git repository)\n our $mimetypes_file = undef;\n \n+our $GITWEB_CONFIG = \"@@GITWEB_CONFIG@@\";\n+require $GITWEB_CONFIG if -e $GITWEB_CONFIG;\n+\n # input validation and dispatch\n our $action = $cgi->param('a');\n if (defined $action) {\n-- \n1.4.2.rc2.g59706-dirty\n"},{"id":"24571","messageId":"E1G8KHP-0004j5-4P@moooo.ath.cx","threadId":"5073","inReplyTo":"20060802165333.GA22726@coredump.intra.peff.net","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-08-02T17:13:11Z","receivedAt":"2006-08-02T17:13:11Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Jeff King <peff@peff.net> wrote:\n> On Wed, Aug 02, 2006 at 11:23:22AM -0500, Jon Loeliger wrote:\n> Why don't we have sensible compile-time defaults that can be overridden\n> by a run-time config file like every other sane program? For those who\n> are opposed to the run-time config, they can simply not have a config\n> file.\n> \n> See the (completely untested) patch below. Obviously the config file\n> name has to be set at build time. However, since it is interpolated by\n> perl, you can do clever things like:\n>   /etc/gitweb/$ENV{MY_VIRTUAL_HOST}.pl\nI like this (it is quite similar to my suggestions :)).\n\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -66,6 +66,9 @@ # file to use for guessing MIME types be\n>  # (relative to the current git repository)\n>  our $mimetypes_file = undef;\n>  \n> +our $GITWEB_CONFIG = \"@@GITWEB_CONFIG@@\";\n> +require $GITWEB_CONFIG if -e $GITWEB_CONFIG;\n> +\n>  # input validation and dispatch\n>  our $action = $cgi->param('a');\n>  if (defined $action) {\nThe only other thing to change is to move the mkdir($git_temp) and\nqx($GIT --version) below this line.\n"},{"id":"24573","messageId":"eaqnm8$gni$1@sea.gmane.org","threadId":"5073","inReplyTo":"20060802165333.GA22726@coredump.intra.peff.net","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-02T17:34:29Z","receivedAt":"2006-08-02T17:34:29Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jeff King wrote:\n\n> On Wed, Aug 02, 2006 at 11:23:22AM -0500, Jon Loeliger wrote:\n> \n>> With this \"params in config.mk\" approach, I have to\n>> run it multiple times, once for each web server I run.\n>>\n>> I _really_ would prefer an \"include from .\" feature\n>> where I can place the specific gitweb_config.pm parts\n>> in the same directory where gitweb.{pl,cgi} is installed.\n> \n> Why don't we have sensible compile-time defaults that can be overridden\n> by a run-time config file like every other sane program? For those who\n> are opposed to the run-time config, they can simply not have a config\n> file.\n> \n> See the (completely untested) patch below. Obviously the config file\n> name has to be set at build time. However, since it is interpolated by\n> perl, you can do clever things like:\n>   /etc/gitweb/$ENV{MY_VIRTUAL_HOST}.pl\n\nBesides, we can use _relative_ paths.\n\nI like this proposal the best.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"24574","messageId":"7virlbuj7p.fsf@assigned-by-dhcp.cox.net","threadId":"5073","inReplyTo":"20060802165333.GA22726@coredump.intra.peff.net","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-02T17:43:22Z","receivedAt":"2006-08-02T17:43:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Why don't we have sensible compile-time defaults that can be overridden\n> by a run-time config file like every other sane program?\n\nI like that approach.\n"},{"id":"24585","messageId":"E1G8MZf-00022S-0v@moooo.ath.cx","threadId":"5073","inReplyTo":"7v8xm8xbaa.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2006-08-02T19:40:11Z","receivedAt":"2006-08-02T19:40:11Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> They all try to make customization can be done in one\n> place, and the difference is mostly of taste, so I'd just pick\n> one from Martin.\nI hope it will be possible (see require suggestion from Jeff King) to\nspecify the file also from the environment because then it is possible\nto develop on an uncostumized version of gitweb.perl.  Now I noticed\na problem: do not use the @@FOO@@ in double quotes because perl will\nspit a lot of warnings like\n\"Possible unintended interpolation of @GIT_VERSION in string\"\nEither we should use another delimiter or use single quotes (this is\nthe way it is done in git-send-email.perl and git-svn.perl).  I don't\nknow how likely it is that characters that are interpreted different\nin double quotes are in filenames but I'd prefer single quotes just to\nbe on the safe site.  This disallows using '/etc/foo/$ENV{SITE_NAME}'\nas config file but one can just use '/etc/foo/bar' which requires\n'/etc/foo/$ENV{SITE_NAME}'.\n"},{"id":"24591","messageId":"20060802203003.61929.qmail@web31802.mail.mud.yahoo.com","threadId":"5073","inReplyTo":"1154535801.19994.15.camel@cashmere.sps.mot.com","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-02T20:30:03Z","receivedAt":"2006-08-02T20:30:03Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Jon Loeliger <jdl@freescale.com> wrote:\n> On Tue, 2006-08-01 at 18:54, Junio C Hamano wrote:\n> \n> > In any case, I think tweaking gitweb.cgi from Makefile like\n> > Martin Waitz did is as easy and clean for people who want to\n> > customize; it should just be the matter of defining the\n> > necessary params in config.mak.\n> \n> I disagree.  I run multiple virtual web servers on one\n> physical machine.  Several of them run different gitweb\n> instances, each with different configurations.\n> \n> With this \"params in config.mk\" approach, I have to\n> run it multiple times, once for each web server I run.\n\nThat's exactly my sentiments.\n\n> I _really_ would prefer an \"include from .\" feature\n> where I can place the specific gitweb_config.pm parts\n> in the same directory where gitweb.{pl,cgi} is installed.\n\nYes, this approach is simple and straightforward enough.\nWhen upgrading, one only needs to do a \"cp\".\n\n> We really need to separate out these config values\n> from the gitweb.{pl,cgi} script itself.  We _need_ to\n> be able to update the gitweb script independently,\n> and easily.\n\nThat's exactly where I was going with this patch.\nI don't want to have to:\n  - configure httpd, or\n  - configure the environment of user \"apache\", or\n  - have a separate forked off branch in order to \"configure\"\n    gitweb at compile time for each gitweb instance I'm running,\n  - etc, etc, etc.\n\nConfiguration, especially of user space programs should be\ncompletely dynamic.  Compilation for user space programs should\nbe a separate process from configuration.\n\n> > I do not think there is much difference between any of the\n> > customization proposed so far (yours, Martin's and the one from\n> > Matthias Lederhofer) from functionality and ease-of-use point of\n> > view.  They all try to make customization can be done in one\n> > place, and the difference is mostly of taste, so I'd just pick\n> > one from Martin.\n> \n> Let's just make sure it is a separate config file, please.\n\nI thing your and mine deployment are pretty similar, thus warranting\na more flexible approach, withouth having to recompile or reconfigure\ncompletely unrelated programs and users.\n\n    Luben\n"},{"id":"24619","messageId":"20060803065852.GH16364@admingilde.org","threadId":"5073","inReplyTo":"46a038f90608011913t777cf20dh9baaf355b19d18e6@mail.gmail.com","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-08-03T06:58:52Z","receivedAt":"2006-08-03T06:58:52Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Wed, Aug 02, 2006 at 02:13:51PM +1200, Martin Langhoff wrote:\n> On 8/2/06, Junio C Hamano <junkio@cox.net> wrote:\n> >I do not think there is much difference between any of the\n> >customization proposed so far (yours, Martin's and the one from\n> >Matthias Lederhofer) from functionality and ease-of-use point of\n> >view.  They all try to make customization can be done in one\n> >place, and the difference is mostly of taste, so I'd just pick\n> >one from Martin\n> \n> I'm a bit lost as to gitweb config. Are we not relying on %ENV for\n> this stuff? Apache's facilities to configure CGIs via ENV are really\n> powerful. You can do conditionals in apache config files, lock stuff\n> down in httpd.conf, override it with files in conf.d, and\n> allow/disallow overrides in .htaccess ...\n\nwe could make the default use %ENV.\n\nSomething like (in Makefile):\n\nGITWEB_SITENAME = $$ENV{GITWEB_SITENAME}\nGITWEB_PROJECTROOT = $$ENV{GITWEB_SITENAME} || \"/pub/git\"\n...\n\nand then change gitweb to not put the expanded config values into\nquotes. So:\n\nour $projectroot = @@GITWEB_PROJECTROOT@@;\n\n\nThis approach would allow both built-time or run-time configuration of\ngitweb.\n\n-- \nMartin Waitz\n"},{"id":"24652","messageId":"20060803162427.GA4215@coredump.intra.peff.net","threadId":"5073","inReplyTo":"20060803065852.GH16364@admingilde.org","subject":"Re: [PATCH] gitweb.cgi: Customization","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2006-08-03T16:24:27Z","receivedAt":"2006-08-03T16:24:27Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 03, 2006 at 08:58:52AM +0200, Martin Waitz wrote:\n\n> we could make the default use %ENV.\n> \n> Something like (in Makefile):\n> \n> GITWEB_SITENAME = $$ENV{GITWEB_SITENAME}\n> GITWEB_PROJECTROOT = $$ENV{GITWEB_SITENAME} || \"/pub/git\"\n\nAn interesting idea, but it means that gitweb.perl no longer parses as\nvalid perl, since we have things like:\n\n> our $projectroot = @@GITWEB_PROJECTROOT@@;\n\nDo the environment variable names really need to be configurable, or\nwould something like this work:\n  1. accept from config file if it exists and defines $projectroot\n  2. otherwise, accept from environment if GITWEB_PROJECTROOT is defined\n  3. otherwise, default to compile-time value\n\nSpeaking of which, perhaps we should clean up the names of variables\nthat are used by the config file now, before they get into widespread\nuse. The names are very inconsistent (e.g., projectroot, git_temp) and\nundocumented. We could standardize on something like\n$GITWEB_PROJECTROOT, matched to GITWEB_PROJECTROOT in the environment\nand GITWEB_PROJECTROOT in the Makefile.\n\n-Peff\n"}]}