Message ID | pull.1536.git.1684883872.gitgitgadget@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | Fix behavior of worktree config in submodules | expand |
"Victoria Dye via GitGitGadget" <gitgitgadget@gmail.com> writes: > 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.
"Victoria Dye via GitGitGadget" <gitgitgadget@gmail.com> writes: > The outcome of this series is that 'extensions.worktreeConfig' and the > contents of the repository's worktree config are read and applied to (and > only to) the relevant repo when working in a super project/submodule setup. Thanks sending these patches! This is an obvious bug, and squashing another global is always helpful. > I'm > also hoping this will help (or at least not hurt) the work to avoid use of > global state in config parsing [2]. Both pieces of work touch different bits I think - yours plumbs and reads a "struct repository" before the config iterating begins, mine plumbs config source information after the config interating - so they don't help each other, but at least the conflicts are only textual. Junio: There are quite a few conflicts. AFAICT each only has to be resolved once (IOW the number of conflicts to be fixed is the same with "git merge" vs "git rebase"). I have a v2 that I'm about to send, and if you'd prefer (especially since you're on half-vacation), I can base it off Victoria's topic, which looks pretty straightforward and will probably get merged pretty quickly.