r/git • ORIG_HEAD • 5d ago

PSA: Patch available for git grep regression.

If you have a git repository with submodules, the following command will return a fatal error (git 2.56.0):

git grep --recurse-submodules -n "hello world" HEAD

There's a patch by Patrick Steinhardt on the mailing list that isn't merged yet: https://lore.kernel.org/git/[email protected]/

To apply:

b4 shazam [email protected]
3 Upvotes

2 comments sorted by

1

u/ResidentPomegranate6 5d ago

until it lands, git submodule foreach runs a plain grep in each submodule, or pin 2.55. the fatal only hits the recursive walk, not per-repo grep.

1

u/fr0z3nph03n1x 4d ago

I'll add this to my list of reasons to avoid submodules.