Repository navigation
Read gvfs.prefetch-use-idx from the merged git config - #2155
Merged
Tyrie Vella (tyrielv) merged 1 commit intoNov 4, 2026
Merged
Tyrie Vella (tyrielv) merged 1 commit into
Tyrie Vella (tyrielv) merged 1 commit into
Conversation
BlobPrefetcher read gvfs.prefetch-use-idx with GitProcess.GetFromLocalConfig and parsed the value with bool.TryParse. Two problems follow: - A value in the global or system git config had no effect. Only the repository's local config enabled the pack-index object existence checker. - Valid git boolean values such as "yes", "on", and "1" were rejected, and the setting silently fell back to the default. Other gvfs.* feature settings (for example gvfs.prefetch-offload, gvfs.trust-pack-indexes, and gvfs.show-hydration-status) read the merged config chain through LibGit2Repo.GetConfigBoolOrDefault. Use the same helper here. It applies git boolean parsing, and it returns the default and logs a warning if the value is invalid or the read fails. Add functional tests that set gvfs.prefetch-use-idx to "yes" only in a temporary global config. One test confirms that prefetch uses the pack-index object existence checker. The other test also sets the key to "false" in the local config and confirms that the local value takes precedence. Assisted-by: Claude Opus 5.5 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Tyrie Vella (tyrielv)
force-pushed
the
tyrielv/prefetch-use-idx-global
branch
from
November 4, 2026 22:11
e2bc68e to
7612b28
Compare
Tyrie Vella (tyrielv)
marked this pull request as ready for review
November 4, 2026 22:14
Tyrie Vella (tyrielv)
enabled auto-merge
November 4, 2026 22:56
|
[KeithBot]: ✅ No issues found · iteration 1 ( Validation
Approving. 🤖 KeithBot · claude-opus-5.5, gpt-6.1-sol, gemini-4-argon · reply on a thread to dispute |
Keith Klein (KeithIsSleeping)
approved these changes
Nov 4, 2026
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
gvfs.prefetch-use-idxenables the pack-index object existence checker for blob prefetch.BlobPrefetcherread this setting withGitProcess.GetFromLocalConfigand parsed it withbool.TryParse. This causes two problems:gvfs.*settings through the user's global git config cannot enable this feature.yes,on, and1, are rejected. The setting then silently falls back to the default (false).Other
gvfs.*feature settings, such asgvfs.prefetch-offload,gvfs.trust-pack-indexes,gvfs.show-hydration-status, andgvfs.mount-progress, read the merged config chain throughLibGit2Repo.GetConfigBoolOrDefault. Nothing in the pack-index checker depends on the config scope. The checker gets its object roots from the enlistment.The default stays
false, so behavior does not change for users who do not set the key.Changes
gvfs.prefetch-use-idxwithLibGit2Repo.GetConfigBoolOrDefaultagainst the enlistment's working directory backing root. This is the same helper thatPrefetchVerbuses forgvfs.prefetch-offload. The helper reads local, global, and system config, applies git boolean parsing, and returns the default with a warning if the value is invalid or the read fails.PrefetchVerbTeststhat setgvfs.prefetch-use-idx=yesonly in a temporary global config and rungvfs prefetch --files. The tests pointHOME(used by libgit2) andGIT_CONFIG_GLOBAL(used by git.exe) at the temporary config. The temporary config includes the original global config files. One test asserts that the prefetch log reports the pack-index object existence checker. The other test also sets the key tofalsein the local config and asserts that the local value takes precedence. The tests restore the local config and delete the temporary config when they complete.Known gaps
libgit2 finds the global config through
HOME/USERPROFILEand ignoresGIT_CONFIG_GLOBAL. IfGIT_CONFIG_GLOBALpoints at another file, git.exe and GVFS can read different global values for this setting. This limit applies to everygvfs.*setting that GVFS reads through libgit2, and this change does not alter it.