Repository navigation
fix(config): wait for a shared git config lock on first run #3199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
fengmk2
merged 6 commits into
voidzero-dev:main
from
naokihaba:naokihaba/investigate-issue-2959
Oct 23, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dd19c6e
fix(config): wait for a shared git config lock on first run
naokihaba 64469e2
test(config): snapshot a first run that cannot take the config lock
naokihaba c7adf3c
Merge branch 'main' into naokihaba/investigate-issue-2959
naokihaba 67a0671
fix(config): treat the 32-bit lock status from old Git for Windows as…
naokihaba a972303
Merge branch 'main' into naokihaba/investigate-issue-2959
naokihaba 49170be
Merge branch 'main' into naokihaba/investigate-issue-2959
naokihaba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...shots/tests/cli_snapshots/fixtures/command_config_first_run_with_config_lock/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "name": "command-config-first-run-with-config-lock" | ||
| } |
11 changes: 11 additions & 0 deletions
11
...ots/tests/cli_snapshots/fixtures/command_config_first_run_with_config_lock/snapshots.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| [[case]] | ||
| name = "command_config_first_run_with_config_lock" | ||
| vp = "global" | ||
| steps = [ | ||
| { argv = ["git", "init"], snapshot = false, continue-on-failure = true }, | ||
| { argv = ["vpt", "touch-file", ".git/config.lock"], snapshot = false, comment = "a concurrent run in a linked worktree holds the shared config lock and does not release it" }, | ||
| { argv = ["vp", "config", "--no-agent"], tty = false, comment = "first run retries the lock, then reports the Git error", continue-on-failure = true }, | ||
| { argv = ["vpt", "rm", ".git/config.lock"], snapshot = false, comment = "the other run releases the lock" }, | ||
| { argv = ["vp", "config", "--no-agent"], tty = false, comment = "next run writes the git config", continue-on-failure = true }, | ||
| { argv = ["git", "config", "--local", "core.hooksPath"], comment = "should be .vite-hooks/_", continue-on-failure = true }, | ||
| ] |
39 changes: 39 additions & 0 deletions
39
...rst_run_with_config_lock/snapshots/command_config_first_run_with_config_lock.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # command_config_first_run_with_config_lock | ||
|
|
||
| ## `git init` | ||
|
|
||
|
|
||
| ## `vpt touch-file .git/config.lock` | ||
|
|
||
| a concurrent run in a linked worktree holds the shared config lock and does not release it | ||
|
|
||
|
|
||
| ## `vp config --no-agent` | ||
|
|
||
| first run retries the lock, then reports the Git error | ||
|
|
||
| **Exit code:** 1 | ||
|
|
||
| ``` | ||
| error: could not lock config file .git/config: File exists | ||
| ``` | ||
|
|
||
| ## `vpt rm .git/config.lock` | ||
|
|
||
| the other run releases the lock | ||
|
|
||
|
|
||
| ## `vp config --no-agent` | ||
|
|
||
| next run writes the git config | ||
|
|
||
| ``` | ||
| ``` | ||
|
|
||
| ## `git config --local core.hooksPath` | ||
|
|
||
| should be .vite-hooks/_ | ||
|
|
||
| ``` | ||
| .vite-hooks/_ | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.