Repository navigation
pnpm install fails in submodule checkouts: install-lefthook cannot enable extensions.worktreeConfig while core.worktree is in the common config #9856
Replies: 1 comment
Confirmed at source — including the CI escape hatch you foundI read
const worktreeText = assertSingle(
directFileConfigValues(root, commonConfigPath, 'core.worktree'),
'core.worktree',
)
if (worktreeText !== undefined) {
throw new Error(
`cannot enable extensions.worktreeConfig while core.worktree is in the common config `
+ `(file:${commonConfigPath}: ${JSON.stringify(worktreeText)}); `
+ 'move it to the main worktree config first',
)
}
Why the check exists, which is what makes the remedy unactionableThe extension is not incidental to what the script is doing. It writes the hook path worktree-scoped ( git(['config', '--worktree', 'core.hooksPath', hooksPath], root)and then asserts the write actually became the effective direct worktree value ( A refinement to your option 1Look at what the value being written actually is: That matters for the submodule case specifically: a submodule's common config governs exactly one worktree, so a plain local Two smaller things from the read
I have not reproduced the submodule layout here — creating one needs network for |
Uh oh!
There was an error while loading. Please reload this page.
Summary
When this repository is checked out as a git submodule of a parent repository, the root
postinstallscript (scripts/install-lefthook.mjs) always fails, sopnpm installexits with code 1. Dependencies install fine andpnpm run buildpasses, but the failing install step breaks scripted/CI setups that check exit codes, prevents lefthook from being installed, and — because ofverifyDepsBeforeRun— the failure re-runs (and warns) on everypnpm run/pnpm dshinvocation.Environment
86a402200d(dsh-v0.2.1-alpha.2-941-g86a402200d, default branch, tested 2026-10-16)packageManagerexactly, so toolchain mismatch is not a factor)Reproduction
Result:
The same failure then re-runs before every
pnpm run/pnpm dshinvocation:Root cause
For any submodule, git itself writes
core.worktree = <relative path back to the worktree>into the module's common config ($PARENT/.git/modules/<name>/config). That is standard submodule behavior, not something the user configured.scripts/install-lefthook.mjsunconditionally needs to enableextensions.worktreeConfig, but refuses to do so whencore.worktreeis present in the common config (check aroundscripts/install-lefthook.mjs:260):Since
core.worktreeis always in the common config for submodules, the script always fails there — and "move it to the main worktree config first" is not actionable, because git needs that entry to locate the submodule worktree.DSH_LEFTHOOK_ALLOW_HOOKS_PATH_OVERRIDEdoes not cover this check (it only handles a pre-existingcore.hooksPathconfigured elsewhere).Impact
pnpm installexits 1 in every submodule checkout, including fresh clones.pnpm runre-triggers the failing pre-run install and prints the warning (noisy, though not blocking).pnpm run builditself passes (9/9 gates on my machine) andpnpm dsh --versionworks, so this does not block building or running — it affects the install exit code, hook installation, and any scripted setup that checks exit codes.Suggested fix
Roughly in order of preference:
.gitis a file, orcore.worktreepresent in the common config) and fall back to a plain, non-worktree-scopedgit config core.hooksPath dsh-hooksin the module config — or simply skip the worktree-config migration — with a warning.DSH_LEFTHOOK_ALLOW_HOOKS_PATH_OVERRIDE.Happy to provide more details or test a fix.
Workaround for consumers (verified)
Until this is fixed, consumers embedding the repo as a git submodule can use the script's own CI short-circuit (line 624) for the install step:
cd deepseek-harness CI=true pnpm installAfter one successful install,
verifyDepsBeforeRunstops re-running the failing install, so subsequentpnpm run/pnpm dshinvocations are clean.CI=trueonly affects two other code paths in the repo (parallelismworker cap and oxlint output format), neither of which impacts build correctness. The trade-off is that lefthook hooks are not installed in the submodule checkout, which only matters if you commit inside the submodule.All reactions