Re: [PATCH v4 3/4] submodule: record superproject gitdir during absorbgitdirs
From: Derrick Stolee <hidden>
Date: 2021-11-08 01:07:06
On 11/4/2021 7:22 PM, Emily Shaffer wrote:
On Mon, Oct 25, 2021 at 12:14:07PM -0400, Derrick Stolee wrote:quoted
Since you're setting this config value inside the submodule's config, what does it mean for a submodule to also be a worktree (and hence require config.worktree)? What happens in this rough scenario? 1. git init sub 2. git init super 3. git -C sub worktree add super/sub 4. git -C super submodule absorbgitdir sub I haven't actually tried running these things, but it seems unusual and unexpected. This doesn't even account for cases where the repo root and a worktree are both submodules within the superproject. If we already have protections preventing these worktrees as submodules, then perhaps there is no need for work here. I'm not familiar enough with the area to make a claim one way or another.Yeah, I think there is actually a test case covering this in t7412:
...
147 test_expect_success 'absorbing fails for a submodule with multiple worktrees' ' 148 test_must_fail git submodule absorbgitdirs sub3 2>error && 149 test_i18ngrep "not supported" error 150 ' That is, I think because 'sub/' in your scenario above has multiple worktrees, the absorbgitdirs will fail. So I won't do additional work here. Thanks.
Good to hear. Thanks for tracking that down. -Stolee