Skip to contentSkip to conversation

gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields

PATCH RESEND Applied Jonathan Nieder 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields

From: Frédéric Brière <[email protected]>
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.

---
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(-)
gitk-git/gitk +4 -2
index 6981cb20..17ba10a8 100755
@@ -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
Signature · 1 line
1.7.9.2
#1 lore raw
Quoted 10 lines · Jonathan Nieder

From: Frédéric Brière <[email protected]>
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.

Thanks, applied.

Paul.