@matheusbsbs / matheus-bagliano / commits / 0270cd0eea
Fork 0

gitweb: Simplify fixed string search

Use '--fixed-strings' option to git-rev-list to simplify and improve searching commit messages (commit search). It allows to search for example for "don't" successfully from gitweb. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jakub Narebski committed Feb 26, 2008 at 13:22 UTC 0270cd0eeaff06f6bee1b52d5cdffb1a6e69c15a
1 file changed +5 -3
gitweb/gitweb.perl
+5 -3
@@ -5254,14 +5254,16 @@ sub git_search {
5254 } elsif ($searchtype eq 'committer') {
5255 $greptype = "--committer=";
5256 }
5257 - $greptype .= $search_regexp;
5258 - my @commitlist = parse_commits($hash, 101, (100 * $page), undef, $greptype);
5257 + $greptype .= $searchtext;
5258 + my @commitlist = parse_commits($hash, 101, (100 * $page), undef,
5259 + $greptype, '--fixed-strings');
5260
5261 my $paging_nav = '';
5262 if ($page > 0) {
5263 $paging_nav .=
5264 $cgi->a({-href => href(action=>"search", hash=>$hash,
5264 - searchtext=>$searchtext, searchtype=>$searchtype)},
5265 + searchtext=>$searchtext,
5266 + searchtype=>$searchtype)},
5267 "first");
5268 $paging_nav .= " &sdot; " .
5269 $cgi->a({-href => href(-replay=>1, page=>$page-1),