repo-settings: consolidate some config settings There are a few important config settings that are not loaded during git_default_config. These are instead loaded on-demand. Centralize these config options to a single scan, and store all of the values in a repo_settings struct. The values for each setting are initialized as negative to indicate "unset". This centralization will be particularly important in a later change to introduce "meta" config settings that change the defaults for these config settings. Signed-off-by: Derrick Stolee dstolee@microsoft.com Signed-off-by: Junio C Hamano gitster@pobox.com authored andgitster committed Aug 13, 2019 Configuration menu Browse the repository at this point in the history
t6501: use 'git gc' in quiet mode t6501-freshen-objects.sh sends the standard error from 'git gc' to a file and verifies that it is empty. This is intended as a way to ensure no warnings are written during the operation. However, as the commit-graph is added as a step to 'git gc', its progress will appear in the output. Pass the '-q' argument to avoid a failing test case when progress is written. Signed-off-by: Derrick Stolee dstolee@microsoft.com Signed-off-by: Junio C Hamano gitster@pobox.com Configuration menu Browse the repository at this point in the history
commit-graph: turn on commit-graph by default The commit-graph feature has seen a lot of activity in the past year or so since it was introduced. The feature is a critical performance enhancement for medium- to large-sized repos, and does not significantly hurt small repos. Change the defaults for core.commitGraph and gc.writeCommitGraph to true so users benefit from this feature by default. There are several places in the test suite where the environment variable GIT_TEST_COMMIT_GRAPH is disabled to avoid reading a commit-graph, if it exists. The config option overrides the environment, so swap these. Some GIT_TEST_COMMIT_GRAPH assignments remain, and those are to avoid writing a commit-graph when a new commit is created. Signed-off-by: Derrick Stolee dstolee@microsoft.com Signed-off-by: Junio C Hamano gitster@pobox.com Configuration menu Browse the repository at this point in the history
repo-settings: parse core.untrackedCache The core.untrackedCache config setting is slightly complicated, so clarify its use and centralize its parsing into the repo settings. The default value is "keep" (returned as -1), which persists the untracked cache if it exists. If the value is set as "false" (returned as 0), then remove the untracked cache if it exists. If the value is set as "true" (returned as 1), then write the untracked cache and persist it. Instead of relying on magic values of -1, 0, and 1, split these options into an enum. This allows the use of "-1" as a default value. After parsing the config options, if the value is unset we can initialize it to UNTRACKED_CACHE_KEEP. Signed-off-by: Derrick Stolee dstolee@microsoft.com Signed-off-by: Junio C Hamano gitster@pobox.com Configuration menu Browse the repository at this point in the history
repo-settings: create feature.manyFiles setting The feature.manyFiles setting is suitable for repos with many files in the working directory. By setting index.version=4 and core.untrackedCache=true, commands such as 'git status' should improve. While adding this setting, modify the index version precedence tests to check how this setting overrides the default for index.version is unset. Signed-off-by: Derrick Stolee dstolee@microsoft.com Signed-off-by: Junio C Hamano gitster@pobox.com 2 Configuration menu Browse the repository at this point in the history
repo-settings: create feature.experimental setting The 'feature.experimental' setting includes config options that are not committed to become defaults, but could use additional testing. Update the following config settings to take new defaults, and to use the repo_settings struct if not already using them:
'pack.useSparse=true'
'fetch.negotiationAlgorithm=skipping' In the case of fetch.negotiationAlgorithm, the existing logic would load the config option only when about to use the setting, so had a die() statement on an unknown string value. This is removed as now the config is parsed under prepare_repo_settings(). In general, this die() is probably misplaced and not valuable. A test was removed that checked this die() statement executed. Signed-off-by: Derrick Stolee dstolee@microsoft.com Signed-off-by: Junio C Hamano gitster@pobox.com Configuration menu Browse the repository at this point in the history