git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git grep does not find all occurrences on macOS
@ 2024-10-14 13:34 David Gstir
  2024-10-15  0:26 ` Taylor Blau
  0 siblings, 1 reply; 6+ messages in thread
From: David Gstir @ 2024-10-14 13:34 UTC (permalink / raw)
  To: git; +Cc: Richard Weinberger

Hi!

I encountered rather subtle issue on in git 2.47.0 on macOS 14.7 (installed from Homebrew):

git grep will not find all occurrences of string patterns containing a “.” under some
conditions. In my case I have an ISO-8859 encoded text file which contains umlauts.
If the string I’m grepping for occurs after a non-ASCII character in this file, git grep
will not find it.

I’ve put up a reproducer here https://github.com/iokill/repro-git-grep-issue, but the gist
of it is "git grep quz.baz" on the ISO-8859-encoded file below will not return anything,
when it should return the line "quz.baz=3":

-->8-------------
foo=bar
umlauts=äöü
quz.baz=3 
--8<-------------

From what I’ve found so far, this occurs on macOS, but not on Linux and it has to be connected
to the regex matching code, because the issue does not occur with --fixed-strings or --perl-regexp.

Thanks!
- David

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

end of thread, other threads:[~2024-10-22  5:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-14 13:34 git grep does not find all occurrences on macOS David Gstir
2024-10-15  0:26 ` Taylor Blau
2024-10-15 20:15   ` René Scharfe
2024-10-20 11:02     ` [PATCH] grep: disable lookahead on error René Scharfe
2024-10-21 21:57       ` Taylor Blau
2024-10-22  5:58       ` David Gstir

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).