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 and the user
has not explicitly turned off the builtin FSMonitor, we now start
the built-in FSMonitor by default.

Only forcing it when UNSET matches the behavior of UPDATE_DEFAULT_BOOL()
used for other repo settings.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
  • Loading branch information
dscho committed Sep 24, 2024
1 parent c71be29 commit a77fce4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions repo-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "config.h"
#include "repository.h"
#include "midx.h"
#include "fsmonitor-ipc.h"
#include "fsmonitor-settings.h"

static void repo_cfg_bool(struct repository *r, const char *key, int *dest,
int def)
Expand Down Expand Up @@ -45,6 +47,30 @@ void prepare_repo_settings(struct repository *r)
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
r->settings.pack_use_bitmap_boundary_traversal = 1;
r->settings.pack_use_multi_pack_reuse = 1;

/*
* Force enable the builtin FSMonitor (unless the repo
* is incompatible or they've already selected it or
* the hook version). But only if they haven't
* explicitly turned it off -- so only if our config
* value is UNSET.
*
* lookup_fsmonitor_settings() and check_for_ipc() do
* not distinguish between explicitly set FALSE and
* UNSET, so we re-test for an UNSET config key here.
*
* I'm not sure I want to fix fsmonitor-settings.c to
* have more than one _DISABLED state since our usage
* here is only to support this experimental period
* (and I don't want to overload the _reason field
* because it describes incompabilities).
*/
if (manyfiles &&
fsmonitor_ipc__is_supported() &&
fsm_settings__get_mode(r) == FSMONITOR_MODE_DISABLED &&
repo_config_get_maybe_bool(r, "core.fsmonitor", &value) > 0 &&
repo_config_get_bool(r, "core.useBuiltinFSMonitor", &value))
fsm_settings__set_ipc(r);
}
if (manyfiles) {
r->settings.index_version = 4;
Expand Down

0 comments on commit a77fce4

Please sign in to comment.