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

[PATCH resend] gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 8, 2012, 12:35 UTC
Message-ID
<20120308123539.GA5862@burratino>
From: Frédéric Brière <fbriere@fbriere.net>
Date: Sun, 14 Mar 2010 18:59:09 -0400

This prevents a search for a number like "105" on "All Fields" from matching against the raw author and commit timestamps. These timestamps were already not searchable by themselves, and the displayed format does not match the query string anyway.

Signed-off-by: Frédéric Brière <fbriere@fbriere.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Last seen at [1].  Since then, the commit message was tweaked for
clarity but not other changes.
[1] http://thread.gmane.org/gmane.comp.version-control.git/142160
 gitk-git/gitk |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 6981cb20..17ba10a8 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -4630,8 +4630,9 @@ proc askfindhighlight {row id} {
     }
     set info $commitinfo($id)
     set isbold 0
-    set fldtypes [list [mc Headline] [mc Author] [mc Date] [mc Committer] [mc CDate] [mc Comments]]
+    set fldtypes [list [mc Headline] [mc Author] "" [mc Committer] "" [mc Comments]]
     foreach f $info ty $fldtypes {
+	if {$ty eq ""} continue
 	if {($findloc eq [mc "All fields"] || $findloc eq $ty) &&
 	    [doesmatch $f]} {
 	    if {$ty eq [mc "Author"]} {
@@ -6492,7 +6493,7 @@ proc findmore {} {
     if {![info exists find_dirn]} {
 	return 0
     }
-    set fldtypes [list [mc "Headline"] [mc "Author"] [mc "Date"] [mc "Committer"] [mc "CDate"] [mc "Comments"]]
+    set fldtypes [list [mc "Headline"] [mc "Author"] "" [mc "Committer"] "" [mc "Comments"]]
     set l $findcurline
     set moretodo 0
     if {$find_dirn > 0} {
@@ -6553,6 +6554,7 @@ proc findmore {} {
 	    }
 	    set info $commitinfo($id)
 	    foreach f $info ty $fldtypes {
+		if {$ty eq ""} continue
 		if {($findloc eq [mc "All fields"] || $findloc eq $ty) &&
 		    [doesmatch $f]} {
 		    set found 1
-- 
1.7.9.2
Next: Paul Mackerras
Message 1 of 2 in “gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields”
  1. gitk: Skip over AUTHOR/COMMIT_DATE when searching all fieldsJonathan Nieder, Mar 8, 2012
  2. Paul MackerrasMar 18, 2012

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.