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

[PATCH 3/4] gitweb: Simplify fixed string search

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 26, 2008, 12:22 UTC
Message-ID
<1204028528-18941-4-git-send-email-jnareb@gmail.com>
In-Reply-To
<1204028528-18941-1-git-send-email-jnareb@gmail.com>

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.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
The second part of this chunk follows "correct style in neighborhood
of changes" idea.
 gitweb/gitweb.perl |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3b4b15a..90cf78e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5254,14 +5254,16 @@ sub git_search {
 		} elsif ($searchtype eq 'committer') {
 			$greptype = "--committer=";
 		}
-		$greptype .= $search_regexp;
-		my @commitlist = parse_commits($hash, 101, (100 * $page), undef, $greptype);
+		$greptype .= $searchtext;
+		my @commitlist = parse_commits($hash, 101, (100 * $page), undef,
+		                               $greptype, '--fixed-strings');
 
 		my $paging_nav = '';
 		if ($page > 0) {
 			$paging_nav .=
 				$cgi->a({-href => href(action=>"search", hash=>$hash,
-				                       searchtext=>$searchtext, searchtype=>$searchtype)},
+				                       searchtext=>$searchtext,
+				                       searchtype=>$searchtype)},
 				        "first");
 			$paging_nav .= " &sdot; " .
 				$cgi->a({-href => href(-replay=>1, page=>$page-1),
-- 
1.5.4.2
Previous: Jakub NarebskiNext: Jakub Narebski
Message 8 of 9 in “Improve gitweb search, and other things”
  1. 0/4 Improve gitweb search, and other thingsJakub Narebski, Feb 26, 2008
  2. 1/4 Add '--fixed-strings' option to "git log --grep" and friendsJakub Narebski, Feb 26, 2008
  3. Junio C HamanoFeb 27, 2008
  4. Jakub NarebskiFeb 27, 2008
  5. 1/4 Add '--fixed-strings' option to "git log --grep" and friendsJakub Narebski, Feb 27, 2008
  6. Junio C HamanoFeb 27, 2008
  7. 2/4 gitweb: Change parse_commits signature to allow for multiple optionsJakub Narebski, Feb 26, 2008
  8. 3/4 gitweb: Simplify fixed string searchJakub Narebski, Feb 26, 2008
  9. 4/4 gitweb: Clearly distinguish regexp / exact match searchesJakub Narebski, Feb 26, 2008

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.