Skip to content

Commit b81dfc6

Browse files
authored
Fast-track of 'git config list --type' correctness (#863)
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`.)
2 parents bea18f5 + 096aa60 commit b81dfc6

File tree

5 files changed

+331
-88
lines changed

5 files changed

+331
-88
lines changed

Documentation/git-config.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ Valid `<type>`'s include:
240240
that the given value is canonicalize-able as an ANSI color, but it is written
241241
as-is.
242242
+
243+
If the command is in `list` mode, then the `--type <type>` argument will apply
244+
to each listed config value. If the value does not successfully parse in that
245+
format, then it will be omitted from the list.
243246

244247
--bool::
245248
--int::

0 commit comments

Comments
 (0)