All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] builtin/grep: fix reading objects from wrong repository
@ 2026-10-30 10:21 Patrick Steinhardt
  2026-10-30 10:21 ` [PATCH 1/3] builtin/grep: read submodule trees via their repository Patrick Steinhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Patrick Steinhardt @ 2026-10-30 10:21 UTC (permalink / raw)
  To: git; +Cc: Root

Hi,

this small patch series fixes the bug reported in [1], where doing `git
grep --recurse-submodules` with nested submodule trees fails to read the
trees. The only patch needed here is the first one, the other patches
are only belt-and-suspenders as I've been checking whether we use the
wrong repository anywhere else.

At the end of this patch series we only use `the_repository` in
`cmd_grep()` itself. Ideally we'd adapt "builtin/grep.c" to get rid of
`the_repository` altogether, but unfortunately it's a bit on the
involved side as we also have to worry about the case where git-grep(1)
is executed outside of a repository with "--no-index". So I skipped that
refactoring for now.

The patch is based on v2.56.0 so that it can be easily backported.

Thanks!

Patrick

[1]: <CAMtVYEjWd2XwJpXdk3PV2jbNdoOaqS3x+08EMu5byy55RxfRmA@mail.gmail.com>

---
Patrick Steinhardt (3):
      builtin/grep: read submodule trees via their repository
      builtin/grep: read sparse directory trees via passed-in repository
      builtin/grep: read ".gitmodules" via passed-in repository

 builtin/grep.c                     |  6 +++---
 t/t7814-grep-recurse-submodules.sh | 23 +++++++++++++++++++++++
 2 files changed, 26 insertions(+), 3 deletions(-)


---
base-commit: a018953688f1b10bddf91bff8747068f5f4746a4
change-id: 20261030-pks-grep-recurse-submodule-20177cc7794c


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

end of thread, other threads:[~2026-10-30 16:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30 10:21 [PATCH 0/3] builtin/grep: fix reading objects from wrong repository Patrick Steinhardt
2026-10-30 10:21 ` [PATCH 1/3] builtin/grep: read submodule trees via their repository Patrick Steinhardt
2026-10-30 16:25   ` Toon Claes
2026-10-30 10:21 ` [PATCH 2/3] builtin/grep: read sparse directory trees via passed-in repository Patrick Steinhardt
2026-10-30 10:21 ` [PATCH 3/3] builtin/grep: read ".gitmodules" " Patrick Steinhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.