Git development
 help / color / mirror / Atom feed
* (Bug report + fix) gitk "IgnCase" search doesn't ignore case
@ 2018-06-14 12:53 Juan Navarro
  2018-06-14 21:44 ` Eric Sunshine
  0 siblings, 1 reply; 2+ messages in thread
From: Juan Navarro @ 2018-06-14 12:53 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1707 bytes --]

Hi,

this question was originally posted on the Google Groups list, trying to 
get help 
(https://groups.google.com/d/topic/git-users/QAFKOQU4eUo/discussion).
Now that it's confirmed as a bug and I have a proposed solution, I'm 
posting here.

Gitk "find commit" search function doesn't follow the "IgnCase" option 
that is selectable with a combo selector on the right side of the 
window; it should be searching in a case-insensitive way, but it doesn't.

Steps to reproduce:
1. Clone any repo. I'm right now using 
https://github.com/Kurento/kms-core.git 
<https://github.com/Kurento/kms-core.git>
2. cd into the repo and launch gitk
3. In the "Find commit" bar, select "changing lines matching"
4. In the right side of the same bar, select "IgnCase"
5. Search for a term that you know exists in uppercase, but write the 
search in lowercase. In my example, I'm searching for "leaky_time".
6. No search results appear.
7. Change your search word to uppercase.
8. Some search results appear, thus proving that the search is being 
done case-sensitive.

The command that gets called when searching is in lines 4804 & 4809 
(https://github.com/git/git/blob/master/gitk-git/gitk#L4804 
<https://github.com/git/git/blob/master/gitk-git/gitk#L4804>):
git diff-tree -r -s --stdin -G<SearchTerm>

Proposed solution is almost trivial: check if the "IgnCase" option is 
enabled, and in that case add the flag "-i" to the git command. Now that 
we are at it, it's probably correct to add that option to all search modes.
A diff is attached to this email, hoping that someone is able to apply 
it (sorry I'm not familiarized with contributing with patch files, but 
the diff is pretty small anyways).

Regards,
Juan

[-- Attachment #2: gitk-igncase.diff --]
[-- Type: text/x-patch, Size: 267 bytes --]

4809c4809,4815
<     set cmd [concat | git diff-tree -r -s --stdin $gdtargs]
---
> 
>     set igncase_arg ""
>     if {$findtype eq [mc "IgnCase"]} {
>         set igncase_arg "-i"
>     }
> 
>     set cmd [concat | git diff-tree $igncase_arg -r -s --stdin $gdtargs]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-14 21:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-14 12:53 (Bug report + fix) gitk "IgnCase" search doesn't ignore case Juan Navarro
2018-06-14 21:44 ` Eric Sunshine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox