Skip to content

Commit 585c27c

Browse files
fbrierepaulusmack
authored andcommitted
gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields
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 <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 6c9e2d1 commit 585c27c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gitk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4659,8 +4659,9 @@ proc askfindhighlight {row id} {
46594659
}
46604660
set info $commitinfo($id)
46614661
set isbold 0
4662-
set fldtypes [list [mc Headline] [mc Author] [mc Date] [mc Committer] [mc CDate] [mc Comments]]
4662+
set fldtypes [list [mc Headline] [mc Author] "" [mc Committer] "" [mc Comments]]
46634663
foreach f $info ty $fldtypes {
4664+
if {$ty eq ""} continue
46644665
if {($findloc eq [mc "All fields"] || $findloc eq $ty) &&
46654666
[doesmatch $f]} {
46664667
if {$ty eq [mc "Author"]} {
@@ -6521,7 +6522,7 @@ proc findmore {} {
65216522
if {![info exists find_dirn]} {
65226523
return 0
65236524
}
6524-
set fldtypes [list [mc "Headline"] [mc "Author"] [mc "Date"] [mc "Committer"] [mc "CDate"] [mc "Comments"]]
6525+
set fldtypes [list [mc "Headline"] [mc "Author"] "" [mc "Committer"] "" [mc "Comments"]]
65256526
set l $findcurline
65266527
set moretodo 0
65276528
if {$find_dirn > 0} {
@@ -6582,6 +6583,7 @@ proc findmore {} {
65826583
}
65836584
set info $commitinfo($id)
65846585
foreach f $info ty $fldtypes {
6586+
if {$ty eq ""} continue
65856587
if {($findloc eq [mc "All fields"] || $findloc eq $ty) &&
65866588
[doesmatch $f]} {
65876589
set found 1

0 commit comments

Comments
 (0)