git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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?
Previous: Jakub Narębski
Message 4 of 4 in “gitweb: fix problem causing erroneous project list”
  1. gitweb: fix problem causing erroneous project listCharles McGarvey, Jun 5, 2013
  2. Junio C HamanoJun 5, 2013
  3. Jakub NarębskiJun 7, 2013
  4. Junio C HamanoJun 7, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.