Skip to content

Commit 0270cd0

Browse files
jnarebgitster
authored andcommitted
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>
1 parent 311e552 commit 0270cd0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gitweb/gitweb.perl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5254,14 +5254,16 @@ sub git_search {
52545254
} elsif ($searchtype eq 'committer') {
52555255
$greptype = "--committer=";
52565256
}
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');
52595260

52605261
my $paging_nav = '';
52615262
if ($page > 0) {
52625263
$paging_nav .=
52635264
$cgi->a({-href => href(action=>"search", hash=>$hash,
5264-
searchtext=>$searchtext, searchtype=>$searchtype)},
5265+
searchtext=>$searchtext,
5266+
searchtype=>$searchtype)},
52655267
"first");
52665268
$paging_nav .= " &sdot; " .
52675269
$cgi->a({-href => href(-replay=>1, page=>$page-1),

0 commit comments

Comments
 (0)