Re: [PATCH 0/2] Fix behavior of worktree config in submodules
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 24, 2023, 10:25 UTC
- Message-ID
- <xmqq4jo2gh5l.fsf@gitster.g>
- In-Reply-To
- <pull.1536.git.1684883872.gitgitgadget@gmail.com>
"Victoria Dye via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 7 quoted lines
> About a year ago, discussion on the sparse index integration of 'git grep' > surfaced larger incompatibilities between sparse-checkout and submodules > [1]. This series fixes one of the underlying issues to that incompatibility, > which is that the worktree config of the submodule (where > 'core.sparseCheckout', 'core.sparseCheckoutCone', and 'index.sparse' are > set) is not used when operating on the submodule from its super project > (e.g., in a command with '--recurse-submodules').
OK. So in short, worktreeConfig used to be a singleton, global for the entire git process, but because "git grep" (and possibly others) wants to operate across repository boundary when recursing into submodules, the repository_format_worktree_config needs to be per repository instance, not a global singleton.
Makes sense.