Skip to content

Commit 80cbb76

Browse files
dschoGit for Windows Build Agent
authored andcommitted
Enable the built-in FSMonitor as an experimental feature
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 <[email protected]> Signed-off-by: Jeff Hostetler <[email protected]>
1 parent 775e937 commit 80cbb76

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

repo-settings.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#include "config.h"
33
#include "repository.h"
44
#include "midx.h"
5-
#include "compat/fsmonitor/fsm-listen.h"
5+
#include "fsmonitor-ipc.h"
6+
#include "fsmonitor-settings.h"
67

78
static void repo_cfg_bool(struct repository *r, const char *key, int *dest,
89
int def)
@@ -43,6 +44,30 @@ void prepare_repo_settings(struct repository *r)
4344
/* Defaults modified by feature.* */
4445
if (experimental) {
4546
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
47+
48+
/*
49+
* Force enable the builtin FSMonitor (unless the repo
50+
* is incompatible or they've already selected it or
51+
* the hook version). But only if they haven't
52+
* explicitly turned it off -- so only if our config
53+
* value is UNSET.
54+
*
55+
* lookup_fsmonitor_settings() and check_for_ipc() do
56+
* not distinguish between explicitly set FALSE and
57+
* UNSET, so we re-test for an UNSET config key here.
58+
*
59+
* I'm not sure I want to fix fsmonitor-settings.c to
60+
* have more than one _DISABLED state since our usage
61+
* here is only to support this experimental period
62+
* (and I don't want to overload the _reason field
63+
* because it describes incompabilities).
64+
*/
65+
if (manyfiles &&
66+
fsmonitor_ipc__is_supported() &&
67+
fsm_settings__get_mode(r) == FSMONITOR_MODE_DISABLED &&
68+
repo_config_get_maybe_bool(r, "core.fsmonitor", &value) > 0 &&
69+
repo_config_get_bool(r, "core.useBuiltinFSMonitor", &value))
70+
fsm_settings__set_ipc(r);
4671
}
4772
if (manyfiles) {
4873
r->settings.index_version = 4;

0 commit comments

Comments
 (0)