feat: Allow config cache for microsoft/git 2.53.0.vfs.0.1+#1
Closed
derrickstolee wants to merge 1 commit intoconfig-listfrom
Closed
feat: Allow config cache for microsoft/git 2.53.0.vfs.0.1+#1derrickstolee wants to merge 1 commit intoconfig-listfrom
derrickstolee wants to merge 1 commit intoconfig-listfrom
Conversation
This was referenced Mar 1, 2026
dscho
added a commit
to microsoft/git
that referenced
this pull request
Mar 6, 2026
See gitgitgadget#2044 for the original review of this change. The main feature here in Git is that `git config list --type=<X>` works correctly. But the real benefit is that we can update GCM to use `git config list --type=<X>` to get the full list of config and store those values in the cache without dozens of `git config --get` calls. See git-ecosystem/git-credential-manager#2268 for the change that adds this cache with a version check for Git 2.54.0. If we additionally add derrickstolee/Git-Credential-Manager-Core#1, then a v2.53.0.vfs.0.1 release would also allow this behavior change. I tested all of these features together against my copy of the Office monorepo running a basic `git fetch`. Note that these runs are not actually downloading much data, if any. | Command | Mean [s] | Min [s] | Max [s] | Relative | |:---|---:|---:|---:|---:| | Without Cache | 14.986 ± 0.255 | 14.558 | 15.192 | 3.29 ± 0.17 | | With Cache | 4.561 ± 0.223 | 4.390 | 4.935 | 1.00 | During this test, I used a single GCM version with these changes and modified the environment variables to change the Git version executed by GCM. * [X] This is an early version of work already under review upstream. (These exact commits are merged to `next`.)
dfba880 to
9790dd6
Compare
0fea6fa to
3125246
Compare
9790dd6 to
fab42ec
Compare
Context: The config cache version gate requires Git 2.54.0+ because that is when upstream Git will include the fix for 'git config list --type=<X>'. However, the microsoft/git fork may fast-track this fix into a 2.53.0.vfs.0.1 release, allowing users of Git for Windows (VFS-enabled builds) to benefit from the cache sooner. Justification: The microsoft/git fork uses version strings like '2.53.0.vfs.0.1' where the '.vfs.' marker distinguishes it from upstream Git. GitVersion parsing stops at the non-integer 'vfs' component, so a simple numeric comparison would treat this as 2.53.0 and disable caching. We need an additional check that recognizes VFS builds and compares their suffix version. The base version (2.53.0) and VFS suffix (0.1) are checked separately, allowing any future 2.53+ VFS build with the fix to also benefit. Upstream 2.54.0+ continues to pass the existing numeric check without hitting the VFS path. Implementation: Added SupportsConfigListType() helper that first checks the upstream minimum (2.54.0), then looks for '.vfs.' in the original version string. For VFS builds, it parses the base version and VFS suffix independently and checks both against their respective minimums (2.53.0 and 0.1). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fab42ec to
a34a5ce
Compare
mjcheetham
added a commit
to git-ecosystem/git-credential-manager
that referenced
this pull request
Mar 18, 2026
In certain repos and on the Windows platform, `git-credential-manager` can take 8-15 seconds before looking up a credential or having any user-facing interaction. This is due to dozens of `git config --get` processes that take 150-250 milliseconds each. The config keys that cause this pain are `http.<url>.sslCAinfo` and `http.<url>.cookieFile`. When `credential.useHttpPath` is enabled, each key is checked as `<url>` is incrementally truncated by directory segment. It would be best if we could call a single Git process to send multiple config queries instead of running multiple processes. gitgitgadget/git#2033 suggested this direction of a single process solution, but it's very complicated! During review of that effort, it was recommended to use `git config list` instead. But then there's a different problem! In all released versions of Git, `git config list` silently ignores the `--type` argument. We need the `--type` argument to guarantee that the resulting output string matches the `bool` or `path` formats. The core Git change in gitgitgadget/git#2044 is now merged to `next` and thus is queued for Git 2.54.0. (We should wait until it merges to `master` before merging this change, just in case.) We can only check compatibility using a version check since the original command silently misbehaves. This pull request allows for caching the list of all config values that match the given types: bool, path, or none. These are loaded lazily so if a command doesn't need one of the types then the command doesn't run. We are also careful to clear this cache if GCM mutates the config. Since we ask for Git config values using `--type=bool`, `--type=path`, _and_ `--no-type`, we may launch three `git config list` commands to satisfy these needs. There is a possibility that this feature is fast-tracked into microsoft/git, in which case the version check would need augmentation. I have that available in derrickstolee#1 as an example. Disclaimer: I used Claude Code and GitHub Copilot CLI to assist with this change. I carefully reviewed the changes and made adjustments based on my own taste and testing. I did an end-to-end performance test on a local monorepo and got these results for improvements to no-op `git fetch` calls: | Command | Mean [s] | Min [s] | Max [s] | Relative | |:---|---:|---:|---:|---:| | Without Cache | 14.986 ± 0.255 | 14.558 | 15.192 | 3.29 ± 0.17 | | With Cache | 4.561 ± 0.223 | 4.390 | 4.935 | 1.00 |
Owner
Author
|
Replaced by git-ecosystem#2296. |
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.
This PR adds an optional VFS version check on top of the core config cache work in the
config-listbranch.Context
The
config-listbranch gates the config cache on Git 2.54.0+, which is when upstream Git will ship the fix forgit config list --type=<X>(gitgitgadget/git#2044). However, the microsoft/git fork may fast-track this fix into a2.53.0.vfs.0.1release.What this adds
A single commit that extends
SupportsConfigListType()to also recognize microsoft/git fork version strings (e.g.,2.53.0.vfs.0.1). The.vfs.marker in the version string distinguishes these builds from upstream, and the VFS suffix is parsed separately to check the minimum version.Why a separate PR
This change is specific to the microsoft/git fork and is not needed for the core PR targeting the upstream git-credential-manager repo. Keeping it as a separate commit makes it easy to include or exclude depending on the target.