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

2 messages from 2010-03-14 to 2010-03-20. Participants: Frédéric Brière, Jonathan Nieder.
Thread: https://gitlist.dev/t/23015

## Frédéric Brière, 2010-03-14 22:59

Subject: [PATCH] gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields
Message-ID: <1268607549-3440-1-git-send-email-fbriere@fbriere.net>
URL: https://gitlist.dev/e/1268607549-3440-1-git-send-email-fbriere%40fbriere.net

```
This prevents searches on "All Fields" from matching against the
author/commit timestamps.  Not only are these timestamps not searchable
by themselves, but the displayed format will not match the query string
anyway.

Signed-off-by: Frédéric Brière <fbriere@fbriere.net>
---
 gitk-git/gitk |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 1f36a3e..d7e3c45 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -4591,8 +4591,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"]} {
@@ -6438,7 +6439,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} {
@@ -6499,6 +6500,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.0

```

## Jonathan Nieder, 2010-03-20 06:42

Subject: Re: [PATCH] gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields
Message-ID: <20100320064248.GA26648@progeny.tock>
URL: https://gitlist.dev/e/20100320064248.GA26648%40progeny.tock
In-Reply-To: <1268607549-3440-1-git-send-email-fbriere@fbriere.net>

```
Frédéric Brière wrote:

> This prevents searches on "All Fields" from matching against the
> author/commit timestamps.  Not only are these timestamps not searchable
> by themselves, but the displayed format will not match the query string
> anyway.
> 
> Signed-off-by: Frédéric Brière <fbriere@fbriere.net>

Reviewed-and-tested-by: Jonathan Nieder <jrnieder@gmail.com>

There’s a follow-up patch to remove the duplicated code this touches
(no functional changes) at <http://bugs.debian.org/465776>.

Thanks again.
Jonathan

```
