Skip to content

Commit

Permalink
gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Frédéric Brière authored and Paul Mackerras committed Mar 18, 2012
1 parent 6c9e2d1 commit 585c27c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -4659,8 +4659,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"]} {
Expand Down Expand Up @@ -6521,7 +6522,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} {
Expand Down Expand Up @@ -6582,6 +6583,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
Expand Down

0 comments on commit 585c27c

Please sign in to comment.