Repository navigation
Avoid GVFS command locks for read-only Git operations - #2138
Open
Tyrie Vella (tyrielv) wants to merge 1 commit into
Open
Tyrie Vella (tyrielv) wants to merge 1 commit into
Tyrie Vella (tyrielv) wants to merge 1 commit into
Conversation
Tyrie Vella (tyrielv)
force-pushed
the
tyrielv/read-only-command-locks
branch
from
October 19, 2026 22:11
abe3253 to
569290d
Compare
Exempt worktree list without relaxing locks for other worktree subcommands. Also exempt audited history, ref-query, object-statistics, and verification operations. Default annotate follows the existing blame policy for working-tree reads. Neither command provides snapshot isolation. Share the hook policy with unit coverage through a partial source file. Add deterministic first-open coverage during a paused worktree-list command. Cover read-only commands under contention and preserve normal status waits. Keep test lock holders alive only for the synchronous test action. Require lock readiness before the action and cover retained dispatcher waits. Use producer-shaped pre-command and post-command metadata in the unit cases. Assisted-by: GPT-6.1 Sol Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Tyrie Vella (tyrielv)
force-pushed
the
tyrielv/read-only-command-locks
branch
from
October 21, 2026 15:43
569290d to
64f6ad8
Compare
Tyrie Vella (tyrielv)
marked this pull request as ready for review
October 21, 2026 15:45
Tyrie Vella (tyrielv)
enabled auto-merge
October 21, 2026 15:45
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem and Context
The command hook takes the global GVFS lock for every worktree subcommand, including the read-only
worktree listcommand. During that lock, GVFS rejects new ordinary-file placeholders withFileNotFound. An unrelated process can therefore fail to open a tracked file that exists in the projection.Several other Git commands also take this lock even though they do not change index membership or tracked working-tree content. Long commands can extend the period in which unrelated first opens fail.
Like
blame, defaultannotatereads working-tree files. This change does not serialize those reads with concurrent worktree mutations. The exclusion also lets defaultannotatecreate its own file placeholders.Changes
worktree list, including porcelain and NUL-delimited output. Keep locks for mutating and unknown worktree subcommands.annotate,check-ref-format,cherry,count-objects,ls-remote,range-diff,shortlog,show-branch,verify-commit,verify-pack, andverify-tag.describe, whose--dirtyand--brokenmodes can write the index. Preserve the existing lock classification for index mutators and arbitrary-command dispatchers.annotateon an unmaterialized file. The contention tests assert lock readiness before they run each command and release the test lock holder before each test returns.statusandfor-each-repostill wait for the lock, with controlled alias configuration in the dispatcher test.The placeholder rejection policy and alias detection remain unchanged. This change does not introduce deferred file opens.