|
2 | 2 | #include "config.h"
|
3 | 3 | #include "repository.h"
|
4 | 4 | #include "midx.h"
|
5 |
| -#include "compat/fsmonitor/fsm-listen.h" |
| 5 | +#include "fsmonitor-ipc.h" |
| 6 | +#include "fsmonitor-settings.h" |
6 | 7 |
|
7 | 8 | static void repo_cfg_bool(struct repository *r, const char *key, int *dest,
|
8 | 9 | int def)
|
@@ -33,6 +34,29 @@ void prepare_repo_settings(struct repository *r)
|
33 | 34 | /* Defaults modified by feature.* */
|
34 | 35 | if (experimental) {
|
35 | 36 | r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
|
| 37 | + |
| 38 | + /* |
| 39 | + * Force enable the builtin FSMonitor (unless the repo |
| 40 | + * is incompatible or they've already selected it or |
| 41 | + * the hook version). But only if they haven't |
| 42 | + * explicitly turned it off -- so only if our config |
| 43 | + * value is UNSET. |
| 44 | + * |
| 45 | + * lookup_fsmonitor_settings() and check_for_ipc() do |
| 46 | + * not distinguish between explicitly set FALSE and |
| 47 | + * UNSET, so we re-test for an UNSET config key here. |
| 48 | + * |
| 49 | + * I'm not sure I want to fix fsmonitor-settings.c to |
| 50 | + * have more than one _DISABLED state since our usage |
| 51 | + * here is only to support this experimental period |
| 52 | + * (and I don't want to overload the _reason field |
| 53 | + * because it describes incompabilities). |
| 54 | + */ |
| 55 | + if (manyfiles && |
| 56 | + fsmonitor_ipc__is_supported() && |
| 57 | + fsm_settings__get_mode(r) == FSMONITOR_MODE_DISABLED && |
| 58 | + repo_config_get_bool(r, "core.usebuiltinfsmonitor", &value)) |
| 59 | + fsm_settings__set_ipc(r); |
36 | 60 | }
|
37 | 61 | if (manyfiles) {
|
38 | 62 | r->settings.index_version = 4;
|
|
0 commit comments