Re: [PATCH v3 3/4] submodule: record superproject gitdir during absorbgitdirs
- From
Emily Shaffer <emilyshaffer@google.com>
- Date
- Oct 13, 2021, 19:42 UTC
- Message-ID
- <YWc2iJ7FQJYCnQ7w@google.com>
- In-Reply-To
- <ecc6c43d-1415-125c-af53-31274a86f656@gmail.com>
On Thu, Aug 19, 2021 at 08:50:27PM -0400, Derrick Stolee wrote:
Show 20 quoted lines
> > On 8/19/2021 4:09 PM, Emily Shaffer wrote: > > + /* cache pointer to superproject's gitdir */ > > + /* NEEDSWORK: this may differ if experimental.worktreeConfig is enabled */ > > + strbuf_addf(&config_path, "%s/config", real_new_git_dir); > > Regarding this NEEDSWORK: you are specifying the config file that > covers every worktree of this submodule, which seems to make sense > to me. The submodule shouldn't have worktrees to itself, right? It > might become a worktree if its superproject has a worktree. > > But also: it's still correct to write to the local, non-worktree > config file even if experimental.worktreeConfig is set. That > config just means "we need to read the worktree config as well > as the local config". > > Or, am I misunderstanding something? > > (I'm advocating for the removal of the NEEDSWORK, in case that > wasn't clear.)
Yeah, I think by pointing from submodule gitdir to superproject gitdir this point goes away, anyways. Regardless of which worktree is in use, the gitdir->gitdir pointer will still be valid. I'll delete the NEEDSWORK.
Show 8 quoted lines
> > > + git_config_set_in_file(config_path.buf, "submodule.superprojectGitdir", > > + relative_path(get_super_prefix_or_empty(), > > + path, &sb)); > > Thanks, > -Stolee >