Skip to content

Commit e332388

Browse files
jeffhostetlerdscho
authored andcommitted
Merge branch 'mark-v4-fsmonitor-experimental' into try-v4-fsmonitor
2 parents f68a147 + 272cf41 commit e332388

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

0 commit comments

Comments
 (0)