GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — `vp config` rewrites unchanged git config on every run, so concurrent runs in linked worktrees fail with "could not lock config file" · Issue #2849 · voidzero-dev/vite-plus Closed DescriptionDescribe the bug
Linked worktrees share one When the run comes from a ReproductionNo project files needed, only a clone with a second worktree: mkdir repro && cd repro && git init -q && git commit -q --allow-empty -m init git worktree add -q ../repro-wt HEAD vp config --no-agent # first run: sets core.hooksPath once for i in $(seq 1 20); do vp config --no-agent >/dev/null 2>&1 || echo FAIL & (cd ../repro-wt && vp config --no-agent >/dev/null 2>&1 || echo FAIL) & wait done | wc -l On my machine this prints 18. Nothing needs to change after the first run, so the expected result is 0. Suggested fixCompare before writing, so a run that changes nothing never takes the lock (this keeps a relative function gitConfigSet(key, value) {
+ if (gitConfigGet(key, { local: true }) === value) return { ok: true };
...
}
function gitConfigUnset(key) {
+ if (gitConfigGet(key, { local: true }) == null) return { ok: true };
...
}
// install()
- const { status, stderr } = spawnSync('git', ['config', 'core.hooksPath', location.target]);
+ const { status, stderr } = existingHooksPath === location.target
+ ? { status: 0, stderr: '' }
+ : spawnSync('git', ['config', 'core.hooksPath', location.target]);With this applied to the 1.0.0 dist as a local patch, 3 parallel runs × 10 rounds gave 0 failures, against 7/10 failures unpatched with 2 in parallel. A first-ever run in a clone still writes, but that happens once per clone rather than once per worktree setup. System Info
Used Package Managerpnpm (12.8.0) Activity
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |