Re: [PATCH] gitweb: fix problem causing erroneous project list
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:35
Jakub Narębski [off-list ref] writes:
quoted
quoted
Instead, clear $search_regexp before dispatching each request. Signed-off-by: Charles McGarvey <redacted>Acked-by: Jakub Narebski <redacted>
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).
quoted
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).
quoted
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.
quoted
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?