On Thu, Aug 19, 2021 at 08:50:27PM -0400, Derrick Stolee wrote:
On 8/19/2021 4:09 PM, Emily Shaffer wrote:
quoted
+ /* 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.
quoted
+ git_config_set_in_file(config_path.buf, "submodule.superprojectGitdir",
+ relative_path(get_super_prefix_or_empty(),
+ path, &sb));
Thanks,
-Stolee