Re: [PATCH] gitweb: fix wrong base URL when non-root DirectoryIndex
- From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
- Date
- Feb 14, 2009, 08:52 UTC
- Message-ID
- <cb7bb73a0902140052h15fa60bfs8a0becab84c997c1@mail.gmail.com>
- In-Reply-To
- <200902140342.26270.jnareb@gmail.com>
On Sat, Feb 14, 2009 at 3:42 AM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 22 quoted lines
> On Sat, 14 Feb 2009, Junio C Hamano wrote:
>> Jakub Narebski <jnareb@gmail.com> writes:
>>
>>>> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
>>>
>>> Sounds good. I don't use gitweb as DirectoryIndex myself, but
>>> Acked-by: Jakub Narebski <jnareb@gmail.com>
>>>
>>>> +# Another issue with the script being the DirectoryIndex is that the resulting
>>>> +# $my_url data is not the full script URL: this is good, because we want
>>>> +# generated links to keep implying the script name if it wasn't explicitly
>>>> +# indicated in the URL we're handling, but it means that $my_url cannot be used
>>>> +# as base URL. Therefore, we have to build the base URL ourselves:
>>>> +our $base_url = $cgi->url(-base => 1) . $ENV{'SCRIPT_NAME'};
>>
>> Breaks t9500 with
>>
>> [Sat Feb 14 02:12:59 2009] gitweb.perl: Use of uninitialized value in
>> concatenation (.) or string at /pub/git/t/../gitweb/gitweb.perl line 45.
>>
>> Please be more careful when giving an Ack, and more importantly please do
>> not send a patch that does not even pass the test suite by itself.Sorry, my fault. For future reference for myself, is there a way to only run the gitweb tests of the testsuite?
Show 9 quoted lines
> Actually this is not a bug in _gitweb_, but in _test_ itself. > > In t/t9500-gitweb-standalone-no-errors.sh we run gitweb.perl as > a standalone script (not from a web server), and we set _some_ of CGI > environmental variables. Up till now we could get by using only most > important ones: GATEWAY_INTERFACE (I'm not sure if needed), HTTP_ACCEPT > (used to select Content-Type to use), REQUEST_METHOD (git_feed exits > early on HEAD request), and of course QUERY_STRING and PATH_INFO. > The required variable SCRIPT_NAME is simply not set...
Thank you for the additional patch. One thing we should also probably add to the test is the HTTP_IF_MODIFIED_SINCE. I will try to think of a bunch of tests to run against feed production after I implement the reflog data check.
-- Giuseppe "Oblomov" Bilotta