Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Concurrent first runs of `vp config` in linked worktrees fail with "could not lock config file"

Geschlossen
#2,959 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@naokihaba arbeitet bereits daran.

Seit 09.10.2026.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

pending triage
Describe the bug

This is a follow-up to #2849.

While prevents vp config from rewriting git config values that are already up to date, the very first run in a fresh clone still has to write them because core.hooksPath, vp.hooks.dir, and vp.hooks.prefix are not set yet.

Linked worktrees share the same .git/config file. Because git fails immediately instead of waiting when config.lock exists, running the initial vp config concurrently across multiple worktrees causes write collisions:

error: could not lock config file /path/to/repo/.git/config: File exists

The command then exits with code 1. If this runs inside a prepare script, the package manager treats it as a lifecycle script failure and aborts the install.

We run into this when setting up multiple worktrees in parallel right after cloning, before any single worktree finishes its setup. Once one command succeeds, subsequent runs simply skip writing and never fail.

Reproduction

https://github.com/naokihaba/vite-plus-config-first-run-lock-repro

Steps to reproduce
1. Clone the reproduction repository and install the dependencies.

   
   git clone https://github.com/naokihaba/vite-plus-config-first-run-lock-repro
   cd vite-plus-config-first-run-lock-repro
   pnpm install --ignore-scripts
   

2. Run the reproduction with two worktrees.

   
   pnpm repro
   

3. You can also run it with four worktrees or use the global CLI if needed.

   
   REPRO_WORKTREES=4 REPRO_ROUNDS=15 bash reproduce.sh
   bash reproduce.sh --global
   

In each round, the script creates a fresh repository with linked worktrees and runs `vp config --no-agent` across all of them at once, so every command acts as a first run.

If at least one lock failure occurs, the script prints a summary and exits with code 0.
System Info
$ vp env current
Node.js:
  Version    24.21.0
  Source     lts
  Bin Path   /Users/naokihaba/.vite-plus/js_runtime/node/24.21.0/bin/node
  Installed  true
  Mode       managed

Package Manager:
  Name       pnpm
  Version    12.10.1
  Source     lockfile or config
  Bin Paths  
    pnpm     /Users/naokihaba/.vite-plus/package_manager/pnpm/12.10.1/pnpm/bin/pnpm
    pnpx     /Users/naokihaba/.vite-plus/package_manager/pnpm/12.10.1/pnpm/bin/pnpx
  Installed  false
  Mode       managed

$ vp --version
vp v1.0.0

Local vite-plus:
  vite-plus  v1.0.0

Tools:
  vite             v8.3.1
  rolldown         v1.2.11
  vitest           v5.0.1
  oxfmt            v0.70.0
  oxlint           v1.85.0
  oxlint-tsgolint  v7.0.2003
  tsdown           v0.23.0

Environment:
  Package manager  pnpm default
  Node.js          v24.21.0

# Additional
git version 2.55.0
macOS 27.0 (arm64)
Node.js v24.20.0 from PATH for the local-mode runs
Used Package Manager

pnpm

Logs
Validations
Vorherrschende Sprache
Rust
Sterne
6.5k
Forks
296
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
227

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus voidzero-dev/vite-plus

Alle Issues in voidzero-dev/vite-plus

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.