From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>, git@vger.kernel.org
Subject: Re: [PATCH (BUGFIX)] gitweb: Fix fixed string (non-regexp) project search
Date: Sat, 3 Mar 2012 11:55:59 +0100 [thread overview]
Message-ID: <201203031156.00948.jnareb@gmail.com> (raw)
In-Reply-To: <7vwr72a6m6.fsf@alter.siamese.dyndns.org>
On Sat, 3 Mar 2012, Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
>> Use $search_regexp, where regex metacharacters are quoted, for
>> searching projects list, rather than $searchtext, which contains
>> original search term.
>>
>> Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
>> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
>> ---
>> I think this bug was here from the very beginning of adding project
>> search, i.e. from v1.6.0.2-446-g0d1d154 (gitweb: Support for simple
>> project search form, 2008-10-03) which was present since 1.6.1
>>
>> On Fri, 2 Mar 2012, Ramsay Jones wrote:
>>
>>> This patch solves the problem for me when using a regex search
>>> (re checkbox checked), but *not* for a non-regex search.
>>>
>
> This patch depends on the more recent changes than the regexp fix, no? I
> was hoping that we could merge the earlier fix for the regexp case to
> older maintenance tracks later, but if we were going to do so, we would
> want to do the same for a fix for fixed-string case.
The regexp and non-regexp bugs and fixes are different.
The regexp "bug" was just us forgetting that regexp is provided by user
input, and should be validated. The bug as reported by Ramsay was here
from the very beginning, i.e. commit 0e55991 (gitweb: Clearly distinguish
regexp / exact match searches, 2008-02-26), which was present in v1.5.1
if I have checked correctly. The fix is about adding new code and should
apply cleanly to 'maint' and even to older versions; the only trouble
with older version might be whitespace issue related to refactoring
code into subroutines.
The non-regexp project search bug was using $searchtext instead of
$search_regexp as search regexp in gitweb. The bug was present from
the very addition of project search, namely commit 0d1d154 (gitweb:
Support for simple project search form, 2008-10-03), which was present
in v1.5.1 if I have checked correctly. Unfortunately the fix affects
code that was changed recently in a1e1b2d (gitweb: improve usability
of projects search form, 2012-01-31); I'll try to come up with equivalent
patch to 'maint' soon (if the current one does not apply, and I guess it
doesn't).
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2012-03-03 10:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-28 18:41 [PATCH (BUGFIX)] gitweb: Handle invalid regexp in regexp search Jakub Narebski
2012-02-28 19:45 ` Junio C Hamano
2012-02-29 15:56 ` Jakub Narebski
2012-03-02 19:44 ` Ramsay Jones
2012-03-02 22:34 ` [PATCH (BUGFIX)] gitweb: Fix fixed string (non-regexp) project search Jakub Narebski
2012-03-03 0:08 ` Junio C Hamano
2012-03-03 10:55 ` Jakub Narebski [this message]
2012-03-04 9:35 ` [PATCH (for maint)] " Jakub Narebski
2012-03-05 5:16 ` Junio C Hamano
2012-03-05 8:59 ` Jakub Narebski
2012-03-05 17:01 ` Junio C Hamano
2012-03-05 23:27 ` Junio C Hamano
2012-03-06 11:59 ` Jakub Narebski
2012-03-04 18:00 ` [PATCH (BUGFIX)] " Jakub Narebski
2012-03-04 23:08 ` Junio C Hamano
2012-03-05 9:03 ` Jakub Narebski
2012-03-05 19:06 ` Ramsay Jones
2012-03-06 12:40 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201203031156.00948.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).