Re: [PATCH] gitweb: fix problem causing erroneous project list
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 7, 2013, 21:59 UTC
- Message-ID
- <7vd2rxshtj.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CANQwDwfiuNSk+woFheqfi527rfutZ2YYH1h3tjuWh0ziwmU+uQ@mail.gmail.com>
Jakub Narębski <jnareb@gmail.com> writes:
Show 5 quoted lines
>>> Instead, clear $search_regexp before dispatching each request. >>> >>> Signed-off-by: Charles McGarvey <chazmcgarvey@brokenzipper.com> > > Acked-by: Jakub Narebski <jnareb@gmail.com>
Thanks (the ack was a few hours too late and the commit is already in 'next', so I won't be able to rewind it though).
Show 7 quoted lines
>> By the way, I looked at how $search_regexp is used in the code: > > How $search_regexp is used does not matter. What was intended > (but was not implemented) is for $search_regexp to matter and to > be used only if $searchtext is defined. $searchtext is reset on each > request, so $search_regexp should be also reset... like in Charles's > patch.
Oh, we are in total agreement about that. That is why the part is marked with "By the way"---it is an orthogonal issue (which turned out to be a non-issue).
Show 8 quoted lines
>> x git_search_files and git_search_grep_body assume that >> $search_regexp can be interpolated in m//, which is not very >> nice. They want an empty string. > > But both git_search_files() and git_search_grep_body() are run from > git_search(), which "dies" (returns HTTP 400 "Text field is empty" error) > if $searchtext is not defined; if $searchtext is defined then $search_regexp > is string and is never undef.
Thanks; that is what I missed.
>> So as an independent fix, the two subs may want to be fixed if we >> want to be undef clean. Or am I missing something?