Skip to content

Commit

Permalink
Enable the built-in FSMonitor as an experimental feature
Browse files Browse the repository at this point in the history
If `feature.experimental` and `feature.manyFiles` are set, we now start
the built-in FSMonitor by default.

Signed-off-by: Jeff Hostetler <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Aug 16, 2021
1 parent 63d2d7b commit 3bcb1a2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions repo-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
#include "config.h"
#include "repository.h"
#include "midx.h"
#include "compat/fsmonitor/fsm-listen.h"
#include "fsmonitor-ipc.h"
#include "fsmonitor-settings.h"

#define UPDATE_DEFAULT_BOOL(s,v) do { if (s == -1) { s = v; } } while(0)

void prepare_repo_settings(struct repository *r)
{
int value;
int value, feature_many_files = 0;
char *strval;

if (r->settings.initialized)
Expand Down Expand Up @@ -62,6 +63,7 @@ void prepare_repo_settings(struct repository *r)
UPDATE_DEFAULT_BOOL(r->settings.core_multi_pack_index, 1);

if (!repo_config_get_bool(r, "feature.manyfiles", &value) && value) {
feature_many_files = 1;
UPDATE_DEFAULT_BOOL(r->settings.index_version, 4);
UPDATE_DEFAULT_BOOL(r->settings.core_untracked_cache, UNTRACKED_CACHE_WRITE);
}
Expand All @@ -70,8 +72,11 @@ void prepare_repo_settings(struct repository *r)
r->settings.fetch_write_commit_graph = value;
UPDATE_DEFAULT_BOOL(r->settings.fetch_write_commit_graph, 0);

if (!repo_config_get_bool(r, "feature.experimental", &value) && value)
if (!repo_config_get_bool(r, "feature.experimental", &value) && value) {
UPDATE_DEFAULT_BOOL(r->settings.fetch_negotiation_algorithm, FETCH_NEGOTIATION_SKIPPING);
if (feature_many_files && fsmonitor_ipc__is_supported())
fsm_settings__set_ipc(r);
}

/* Hack for test programs like test-dump-untracked-cache */
if (ignore_untracked_cache_config)
Expand Down

0 comments on commit 3bcb1a2

Please sign in to comment.