Skip to content

Commit e3a2d3d

Browse files
jeffhostetlermjcheetham
authored andcommitted
Merge branch 'mark-v4-fsmonitor-experimental' into try-v4-fsmonitor
2 parents 969bfbe + 583862f commit e3a2d3d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

repo-settings.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include "config.h"
33
#include "repository.h"
44
#include "midx.h"
5+
#include "fsmonitor-ipc.h"
6+
#include "fsmonitor-settings.h"
57

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

0 commit comments

Comments
 (0)