{"thread":{"id":"24520","subject":"Potential bug in gitweb 1.7.2","startedAt":"2010-07-26T04:55:06Z","lastAt":"2010-08-02T21:25:22Z","messageCount":15,"participants":["Julio Lajara","Jonathan Nieder","Anders Kaseorg","Jakub Narebski","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"146341","messageId":"4C4D152A.7050505@gmail.com","threadId":"24520","inReplyTo":null,"subject":"Potential bug in gitweb 1.7.2","fromName":"Julio Lajara","fromEmail":"ju2wheels@gmail.com","sentAt":"2010-07-26T04:55:06Z","receivedAt":"2010-07-26T04:55:06Z","isPatch":false,"sender":{"key":"ju2wheels@gmail.com","avatar":"https://gravatar.com/avatar/8346065b62031ef0ba17efd4d6d8a0f587959c5b88156e050aca2f5396eca1c2?d=mp&s=160"},"body":"Hi all, I recently had git/gitweb (1.7.0.4) setup on my Ubuntu 10.04 box \nand decided to add ppa:git-core/ppa to get up to 1.7.2. After I did so, \nmy previously working gitweb stopped functioning and only shows a blank \npage. Im using apache/cgi and the following error is what I found in my \napache error log:\n\n[Sat Jul 24 23:11:41 2010] [error] [client 192.168.1.100] Can't call \nmethod \"http\" on an undefined value at /usr/share/gitweb/index.cgi line \n3401., referer: http://192.168.1.142/gitweb/\n\n\n From the latest source:\ncat -n gitweb.perl | grep 3401\n   3401        if (defined $cgi->http('HTTP_ACCEPT') &&\n\nThanks,\n"},{"id":"146343","messageId":"20100726050849.GA16858@burratino","threadId":"24520","inReplyTo":"4C4D152A.7050505@gmail.com","subject":"Re: Potential bug in gitweb 1.7.2","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-26T05:08:49Z","receivedAt":"2010-07-26T05:08:49Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Julio,\n\nJulio Lajara wrote:\n\n> Hi all, I recently had git/gitweb (1.7.0.4) setup on my Ubuntu 10.04\n> box and decided to add ppa:git-core/ppa to get up to 1.7.2. After I\n> did so, my previously working gitweb stopped functioning\n\nIndeed, the rules for installation have changed with v1.7.2, so\nthe packaging may need to be adjusted[1] to match (see\ngitweb/INSTALL).  Please report this to the Ubuntu git team.\n\n(I am not sure what the proper way to do that is.\nhttps://bugs.launchpad.net/ubuntu/+source/git/+filebug will at\nleast reach the right people.)\n\nHope that helps,\nJonathan\n\n[1] e.g. http://repo.or.cz/w/debian-git/jrn.git/commit/ff41c31c5\n"},{"id":"146358","messageId":"alpine.DEB.2.00.1007260508290.14251@dr-wily.mit.edu","threadId":"24520","inReplyTo":"20100726050849.GA16858@burratino","subject":"Re: Potential bug in gitweb 1.7.2","fromName":"Anders Kaseorg","fromEmail":"andersk@mit.edu","sentAt":"2010-07-26T09:27:54Z","receivedAt":"2010-07-26T09:27:54Z","isPatch":false,"sender":{"key":"andersk@mit.edu","avatar":"https://avatars.githubusercontent.com/u/26471?v=4"},"body":"On Mon, 26 Jul 2010, Jonathan Nieder wrote:\n> Indeed, the rules for installation have changed with v1.7.2, so the \n> packaging may need to be adjusted[1] to match (see gitweb/INSTALL).  \n> Please report this to the Ubuntu git team.\n> \n> [1] e.g. http://repo.or.cz/w/debian-git/jrn.git/commit/ff41c31c5\n\nThanks for the report.  But, the 1.7.2-0ppa1 package in the git-core PPA \nwas constructed by merging your jrn/for-gerrit branch (1.7.2~rc3-0.1, \ncommit f84e1eb) with upstream v1.7.2, and updating \ndebian/versions.upstream and debian/changelog.upstream.  It already \nincludes that commit.\n\nIndeed, when I install the gitweb 1.7.2-0ppa1 package, put some \nrepositories into /var/cache/git, and go to http://localhost/gitweb/ , it \nworks correctly for me.\n\nThe error that Julio originally posted:\n\n> > [Sat Jul 24 23:11:41 2010] [error] [client 192.168.1.100] Can't call \n> > method \"http\" on an undefined value at /usr/share/gitweb/index.cgi \n> > line 3401., referer: http://192.168.1.142/gitweb/\n\nlooks very strange, and does not seem like it would result from just a \npackaging problem.\n\nAnders\n"},{"id":"146370","messageId":"4C4D8940.80802@gmail.com","threadId":"24520","inReplyTo":"alpine.DEB.2.00.1007260508290.14251@dr-wily.mit.edu","subject":"Re: Potential bug in gitweb 1.7.2","fromName":"Julio Lajara","fromEmail":"ju2wheels@gmail.com","sentAt":"2010-07-26T13:10:24Z","receivedAt":"2010-07-26T13:10:24Z","isPatch":false,"sender":{"key":"ju2wheels@gmail.com","avatar":"https://gravatar.com/avatar/8346065b62031ef0ba17efd4d6d8a0f587959c5b88156e050aca2f5396eca1c2?d=mp&s=160"},"body":"Hi Anders, thanks for the input. I will begin chasing down the issue in \nmy config then, but its strange that it would stop working as the exact \nsame configuration works without issue in 1.7.0.4 . Ill follow up with \nwhat I find.\n\nThanks,\n\nOn 07/26/2010 05:27 AM, Anders Kaseorg wrote:\n> On Mon, 26 Jul 2010, Jonathan Nieder wrote:\n>    \n>> Indeed, the rules for installation have changed with v1.7.2, so the\n>> packaging may need to be adjusted[1] to match (see gitweb/INSTALL).\n>> Please report this to the Ubuntu git team.\n>>\n>> [1] e.g. http://repo.or.cz/w/debian-git/jrn.git/commit/ff41c31c5\n>>      \n> Thanks for the report.  But, the 1.7.2-0ppa1 package in the git-core PPA\n> was constructed by merging your jrn/for-gerrit branch (1.7.2~rc3-0.1,\n> commit f84e1eb) with upstream v1.7.2, and updating\n> debian/versions.upstream and debian/changelog.upstream.  It already\n> includes that commit.\n>\n> Indeed, when I install the gitweb 1.7.2-0ppa1 package, put some\n> repositories into /var/cache/git, and go to http://localhost/gitweb/ , it\n> works correctly for me.\n>\n> The error that Julio originally posted:\n>\n>    \n>>> [Sat Jul 24 23:11:41 2010] [error] [client 192.168.1.100] Can't call\n>>> method \"http\" on an undefined value at /usr/share/gitweb/index.cgi\n>>> line 3401., referer: http://192.168.1.142/gitweb/\n>>>        \n> looks very strange, and does not seem like it would result from just a\n> packaging problem.\n>\n> Anders\n>\n>    \n"},{"id":"146373","messageId":"201007261536.11688.jnareb@gmail.com","threadId":"24520","inReplyTo":"4C4D8940.80802@gmail.com","subject":"Re: Potential bug in gitweb 1.7.2","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-07-26T13:36:10Z","receivedAt":"2010-07-26T13:36:10Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Mon, 26 Jul 2010, Julio Lajara wrote:\n\n> Hi Anders, thanks for the input. I will begin chasing down the issue in \n> my config then, but its strange that it would stop working as the exact \n> same configuration works without issue in 1.7.0.4 . Ill follow up with \n> what I find.\n> \n> On 07/26/2010 05:27 AM, Anders Kaseorg wrote:\n\n>> The error that Julio originally posted:\n>>\n>>    \n>>>> [Sat Jul 24 23:11:41 2010] [error] [client 192.168.1.100] Can't call\n>>>> method \"http\" on an undefined value at /usr/share/gitweb/index.cgi\n>>>> line 3401., referer: http://192.168.1.142/gitweb/\n>>        \n>> looks very strange, and does not seem like it would result from just a\n>> packaging problem.\n\nJulio, could you show us the neigbourhood of line 3401 in your index.cgi\nfile?  What is this index.cgi file - git doesn't have it?\n\n-- \nJakub Narebski\nPoland\n"},{"id":"146374","messageId":"AANLkTinAO8R6mg967XeqFgMHInT4pMlxODz29Jovfki1@mail.gmail.com","threadId":"24520","inReplyTo":"201007261536.11688.jnareb@gmail.com","subject":"Re: Potential bug in gitweb 1.7.2","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-26T13:39:00Z","receivedAt":"2010-07-26T13:39:00Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Jul 26, 2010 at 13:36, Jakub Narebski <jnareb@gmail.com> wrote:\n> On Mon, 26 Jul 2010, Julio Lajara wrote:\n>\n>> Hi Anders, thanks for the input. I will begin chasing down the issue in\n>> my config then, but its strange that it would stop working as the exact\n>> same configuration works without issue in 1.7.0.4 . Ill follow up with\n>> what I find.\n>>\n>> On 07/26/2010 05:27 AM, Anders Kaseorg wrote:\n>\n>>> The error that Julio originally posted:\n>>>\n>>>\n>>>>> [Sat Jul 24 23:11:41 2010] [error] [client 192.168.1.100] Can't call\n>>>>> method \"http\" on an undefined value at /usr/share/gitweb/index.cgi\n>>>>> line 3401., referer: http://192.168.1.142/gitweb/\n>>>\n>>> looks very strange, and does not seem like it would result from just a\n>>> packaging problem.\n>\n> Julio, could you show us the neigbourhood of line 3401 in your index.cgi\n> file?  What is this index.cgi file - git doesn't have it?\n\nHis index.cgi is just gitweb.cgi under a different name. Line 3401 is\nthe same as gitweb/gitweb.cgi in the 1.7.2 release.\n"},{"id":"146375","messageId":"4C4D932A.1010101@gmail.com","threadId":"24520","inReplyTo":"AANLkTinAO8R6mg967XeqFgMHInT4pMlxODz29Jovfki1@mail.gmail.com","subject":"Re: Potential bug in gitweb 1.7.2","fromName":"Julio Lajara","fromEmail":"ju2wheels@gmail.com","sentAt":"2010-07-26T13:52:42Z","receivedAt":"2010-07-26T13:52:42Z","isPatch":false,"sender":{"key":"ju2wheels@gmail.com","avatar":"https://gravatar.com/avatar/8346065b62031ef0ba17efd4d6d8a0f587959c5b88156e050aca2f5396eca1c2?d=mp&s=160"},"body":"Hi, Ive managed to narrow down the issue to a line in the gitolite's \ncontrib/gitweb/gitweb.conf that I appended to the default \n/etc/gitweb.conf . It was working with 1.7.0.4 but 1.7.2 doesnt like \nthis line:\n\n$ENV{GL_USER} = $cgi->remote_user || \"gitweb\";\n\nI corrected it by just setting it equal to gitweb and all is well now.\n\nThanks,\n\nOn 07/26/2010 09:39 AM, Ævar Arnfjörð Bjarmason wrote:\n> On Mon, Jul 26, 2010 at 13:36, Jakub Narebski<jnareb@gmail.com>  wrote:\n>    \n>> On Mon, 26 Jul 2010, Julio Lajara wrote:\n>>\n>>      \n>>> Hi Anders, thanks for the input. I will begin chasing down the issue in\n>>> my config then, but its strange that it would stop working as the exact\n>>> same configuration works without issue in 1.7.0.4 . Ill follow up with\n>>> what I find.\n>>>\n>>> On 07/26/2010 05:27 AM, Anders Kaseorg wrote:\n>>>        \n>>      \n>>>> The error that Julio originally posted:\n>>>>\n>>>>\n>>>>          \n>>>>>> [Sat Jul 24 23:11:41 2010] [error] [client 192.168.1.100] Can't call\n>>>>>> method \"http\" on an undefined value at /usr/share/gitweb/index.cgi\n>>>>>> line 3401., referer: http://192.168.1.142/gitweb/\n>>>>>>              \n>>>> looks very strange, and does not seem like it would result from just a\n>>>> packaging problem.\n>>>>          \n>> Julio, could you show us the neigbourhood of line 3401 in your index.cgi\n>> file?  What is this index.cgi file - git doesn't have it?\n>>      \n> His index.cgi is just gitweb.cgi under a different name. Line 3401 is\n> the same as gitweb/gitweb.cgi in the 1.7.2 release.\n>    \n"},{"id":"146379","messageId":"201007261623.05850.jnareb@gmail.com","threadId":"24520","inReplyTo":"4C4D932A.1010101@gmail.com","subject":"Re: Potential bug in gitweb 1.7.2","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-07-26T14:23:04Z","receivedAt":"2010-07-26T14:23:04Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Mon, 26 Jul 2010, Julio Lajara wrote:\n\n> Hi, Ive managed to narrow down the issue to a line in the gitolite's \n> contrib/gitweb/gitweb.conf that I appended to the default \n> /etc/gitweb.conf . It was working with 1.7.0.4 but 1.7.2 doesnt like \n> this line:\n> \n> $ENV{GL_USER} = $cgi->remote_user || \"gitweb\";\n> \n> I corrected it by just setting it equal to gitweb and all is well now.\n\nI think the following commit is the reason that this stopped working\n869d588 (gitweb: Move evaluate_gitweb_config out of run_request, 2010-07-05)\n\n>From its commit message:\n\n    gitweb: Move evaluate_gitweb_config out of run_request\n    \n    Move evaluate_gitweb_config() and evaluate_git_version() out of\n    run_request() to run(), making them not run one for each request.\n    This changes how git behaves in FastCGI case.\n    \n    This change makes it impossible to have config which changes with\n    request, but I don't think anyone relied on such (hidden action)\n    behavior.\n\nI guess I was wrong about that.  I wonder if it would be possible to \nre-enable this feature (which I think is needed to be able to use\n$cgi->remote_user) but without having all pay the [slight] performance\npenalty of including (and I think parsing) config file once per each\nrequest.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"146382","messageId":"20100726152356.GA6564@burratino","threadId":"24520","inReplyTo":"alpine.DEB.2.00.1007260508290.14251@dr-wily.mit.edu","subject":"Re: Potential bug in gitweb 1.7.2","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-26T15:23:56Z","receivedAt":"2010-07-26T15:23:56Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Anders,\n\nAnders Kaseorg wrote:\n\n> the 1.7.2-0ppa1 package in the git-core PPA \n> was constructed by merging your jrn/for-gerrit branch (1.7.2~rc3-0.1, \n> commit f84e1eb) with upstream v1.7.2, and updating \n> debian/versions.upstream and debian/changelog.upstream.  It already \n> includes that commit.\n\nGood to know.  Is there a public git repository for the PPA?  (I am\nasking selfishly, because it would be convenient to be able to tell\nwhat commit each version corresponds to and to steal changes\nback.)\n\n> Indeed, when I install the gitweb 1.7.2-0ppa1 package, put some \n> repositories into /var/cache/git, and go to http://localhost/gitweb/ , it \n> works correctly for me.\n\nHm, I should have tried that myself.\n\nThanks.\n"},{"id":"146419","messageId":"alpine.DEB.2.00.1007261346060.14251@dr-wily.mit.edu","threadId":"24520","inReplyTo":"20100726152356.GA6564@burratino","subject":"Re: Potential bug in gitweb 1.7.2","fromName":"Anders Kaseorg","fromEmail":"andersk@mit.edu","sentAt":"2010-07-26T18:50:59Z","receivedAt":"2010-07-26T18:50:59Z","isPatch":false,"sender":{"key":"andersk@mit.edu","avatar":"https://avatars.githubusercontent.com/u/26471?v=4"},"body":"On Mon, 26 Jul 2010, Jonathan Nieder wrote:\n> Good to know.  Is there a public git repository for the PPA?  (I am \n> asking selfishly, because it would be convenient to be able to tell what \n> commit each version corresponds to and to steal changes back.)\n\nThere is now:\n  git://andersk.mit.edu/git.git\n  http://andersk.mit.edu/gitweb/git.git\n(The most recent version is on the ppa branch, but there are tags going \nback through 1.7.0.1-1~ppa1.)\n\nAnders\n"},{"id":"146442","messageId":"20100727000910.GB3460@burratino","threadId":"24520","inReplyTo":"alpine.DEB.2.00.1007261346060.14251@dr-wily.mit.edu","subject":"Re: Potential bug in gitweb 1.7.2","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-27T00:09:10Z","receivedAt":"2010-07-27T00:09:10Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Anders Kaseorg wrote:\n\n>   git://andersk.mit.edu/git.git\n\nThanks!\n\nFWIW (because this does not seem to have been advertised widely)\nthere's a mailing list to coordinate work on the Debian git packages.\n\nAnyone interested can send mail (with any content) to\n<debian-package-git-help@list.smarden.org> for a list of supported\ncommands or <debian-package-git-subscribe@list.smarden.org> to\nsubscribe.\n"},{"id":"146827","messageId":"20100731030159.GD906@burratino","threadId":"24520","inReplyTo":"201007261623.05850.jnareb@gmail.com","subject":"[PATCH/RFC] gitweb: allow configurations that change with each request","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-31T03:01:59Z","receivedAt":"2010-07-31T03:01:59Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"gitolite's contrib/gitweb/gitweb.conf includes:\n\n\t$ENV{GL_USER} = $cgi->remote_user || \"gitweb\";\n\nwhich is useful for setups where a user has to be authenticated\nto access certain repos.  Perhaps other typical configurations\nchange per session in other ways, too.\n\nv1.7.2-rc2~6 (gitweb: Move evaluate_gitweb_config out of run_request,\n2010-07-05) broke such configurations for a speedup, by loading\nthe configuration once per FastCGI process.\n\nProbably in the end there should be a way to specify in the\nconfiguration whether a particular installation wants the speedup or\nthe flexibility.  But for now it is easier to just undo the relevant\nchange.\n\nThis partially reverts commit 869d58813b24c74e84c9388041eafcef40cb51e4.\n\nReported-by: Julio Lajara <julio.lajara@alum.rpi.edu>\nAnalysis-by: Jakub Narebski <jnareb@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nJakub Narebski wrote:\n\n> I wonder if it would be possible to \n> re-enable this feature (which I think is needed to be able to use\n> $cgi->remote_user) but without having all pay the [slight] performance\n> penalty of including (and I think parsing) config file once per each\n> request.\n\nI dunno.  Maybe this would be a good place to start.\n\n gitweb/gitweb.perl |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex e0e9532..300c4b1 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1060,8 +1060,12 @@ sub run_request {\n \treset_timer();\n \n \tevaluate_uri();\n+\tevaluate_gitweb_config();\n \tcheck_loadavg();\n \n+\t# $projectroot and $projects_list might be set in gitweb config file\n+\t$projects_list ||= $projectroot;\n+\n \tevaluate_query_params();\n \tevaluate_path_info();\n \tevaluate_and_validate_params();\n@@ -1109,12 +1113,8 @@ sub evaluate_argv {\n \n sub run {\n \tevaluate_argv();\n-\tevaluate_gitweb_config();\n \tevaluate_git_version();\n \n-\t# $projectroot and $projects_list might be set in gitweb config file\n-\t$projects_list ||= $projectroot;\n-\n \t$pre_listen_hook->()\n \t\tif $pre_listen_hook;\n \n-- \n1.7.2.1.544.ga752d.dirty\n"},{"id":"146975","messageId":"201008022135.58287.jnareb@gmail.com","threadId":"24520","inReplyTo":"20100731030159.GD906@burratino","subject":"Re: [PATCH/RFC] gitweb: allow configurations that change with each request","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-08-02T19:35:57Z","receivedAt":"2010-08-02T19:35:57Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Sat, 31 Jul 2010, Jonathan Nieder wrote:\n\n> gitolite's contrib/gitweb/gitweb.conf includes:\n> \n> \t$ENV{GL_USER} = $cgi->remote_user || \"gitweb\";\n> \n> which is useful for setups where a user has to be authenticated\n> to access certain repos.  Perhaps other typical configurations\n> change per session in other ways, too.\n> \n> v1.7.2-rc2~6 (gitweb: Move evaluate_gitweb_config out of run_request,\n> 2010-07-05) broke such configurations for a speedup, by loading\n> the configuration once per FastCGI process.\n> \n> Probably in the end there should be a way to specify in the\n> configuration whether a particular installation wants the speedup or\n> the flexibility.  But for now it is easier to just undo the relevant\n> change.\n> \n> This partially reverts commit 869d58813b24c74e84c9388041eafcef40cb51e4.\n\nWhy only *partially* reverts...\n\n...ah, I see, I did \"while at it\" change fixing timer and number of git\ncommands info for persistent environments (i.e. gitweb run as FastCGI\nscript).\n \n> Reported-by: Julio Lajara <julio.lajara@alum.rpi.edu>\n> Analysis-by: Jakub Narebski <jnareb@gmail.com>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n\nReluctantly-acked-by: Jakub Narebski <jnareb@gmail.com>\n\n> ---\n> Jakub Narebski wrote:\n> \n> > I wonder if it would be possible to \n> > re-enable this feature (which I think is needed to be able to use\n> > $cgi->remote_user) but without having all pay the [slight] performance\n> > penalty of including (and I think parsing) config file once per each\n> > request.\n> \n> I dunno.  Maybe this would be a good place to start.\n\nCurrently this is non-issue; the eventual performance penalty is I guess\nvery small.\n\nThe problem would be with adding caching support to gitweb.  While\ndefault GitwebCache::* caching engine should have low startup cost, \nthe CHI generic caching interface that one might want to use instead\nuses Moose (Mouse with Any::Moose?) for OOP, which imposes some startup\ncost.  One enables and configures output caching in gitweb config, so\nif gitweb config would be read once per run then cache interface could\nbe started once per run, not once per request.\n \nNevertheless this change is backwards incompatibile change, and should\nprobably wait for 1.7.3 (pity that 1.7.2 was so recently released).\n\n\nOne solution I can think of (still backwards incompatibile) would be to\nprovide $per_request_config variable, which would hold anonymous sub\nwith parts of config that need to be done per request (this should work\nwith global variables (our), but I think it wouldn't work with lexical\nvariables (my)).  For example gitolite's contrib/gitweb/gitweb.conf would\nthen include:\n\n  $per_request_config = sub {\n  \t$ENV{GL_USER} = $cgi->remote_user || \"gitweb\";\n  }\n\nWhat do you think about it?\n\n>  gitweb/gitweb.perl |    8 ++++----\n>  1 files changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index e0e9532..300c4b1 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -1060,8 +1060,12 @@ sub run_request {\n>  \treset_timer();\n>  \n>  \tevaluate_uri();\n> +\tevaluate_gitweb_config();\n>  \tcheck_loadavg();\n>  \n> +\t# $projectroot and $projects_list might be set in gitweb config file\n> +\t$projects_list ||= $projectroot;\n> +\n>  \tevaluate_query_params();\n>  \tevaluate_path_info();\n>  \tevaluate_and_validate_params();\n> @@ -1109,12 +1113,8 @@ sub evaluate_argv {\n>  \n>  sub run {\n>  \tevaluate_argv();\n> -\tevaluate_gitweb_config();\n>  \tevaluate_git_version();\n>  \n> -\t# $projectroot and $projects_list might be set in gitweb config file\n> -\t$projects_list ||= $projectroot;\n> -\n>  \t$pre_listen_hook->()\n>  \t\tif $pre_listen_hook;\n>  \n\nThat reminds me: '$projects_list ||= $projectroot;' line should be put,\nI think, inside evaluate_gitweb_config().  But that of course should not\nbe done in this patch.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"146991","messageId":"20100802210121.GA3072@burratino","threadId":"24520","inReplyTo":"201008022135.58287.jnareb@gmail.com","subject":"Re: [PATCH/RFC] gitweb: allow configurations that change with each request","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-02T21:01:57Z","receivedAt":"2010-08-02T21:01:57Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jakub Narebski wrote:\n\n> One solution I can think of (still backwards incompatibile) would be to\n> provide $per_request_config variable, which would hold anonymous sub\n> with parts of config that need to be done per request (this should work\n> with global variables (our), but I think it wouldn't work with lexical\n> variables (my)).  For example gitolite's contrib/gitweb/gitweb.conf would\n> then include:\n> \n>   $per_request_config = sub {\n>   \t$ENV{GL_USER} = $cgi->remote_user || \"gitweb\";\n>   }\n\nHow would that interact with caching?  i.e., how would whatever caching\nengine is used learn that $cgi->remote_user is part of the key needed to\nuniquely determine a response?\n"},{"id":"146996","messageId":"201008022325.23670.jnareb@gmail.com","threadId":"24520","inReplyTo":"20100802210121.GA3072@burratino","subject":"Re: [PATCH/RFC] gitweb: allow configurations that change with each request","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-08-02T21:25:22Z","receivedAt":"2010-08-02T21:25:22Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jonathan Nieder wrote:\n> Jakub Narebski wrote:\n> \n> > One solution I can think of (still backwards incompatibile) would be to\n> > provide $per_request_config variable, which would hold anonymous sub\n> > with parts of config that need to be done per request (this should work\n> > with global variables (our), but I think it wouldn't work with lexical\n> > variables (my)).  For example gitolite's contrib/gitweb/gitweb.conf would\n> > then include:\n> > \n> >   $per_request_config = sub {\n> >   \t$ENV{GL_USER} = $cgi->remote_user || \"gitweb\";\n> >   }\n> \n> How would that interact with caching?  i.e., how would whatever caching\n> engine is used learn that $cgi->remote_user is part of the key needed to\n> uniquely determine a response?\n\nWell, obviously caching itself, including generating cache key, would be\ndone per-request.  It is only *initializing* cache (i.e. require + \n+ $cache->new()) that should be done once per run and not once per \nrequest.\n\nBut nevermind, this might be not much of a problem.  I'll start with\ncache re-initialized on each request for start.\n\n-- \nJakub Narebski\nPoland\n"}]}