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
#define UPDATE_DEFAULT_BOOL (s ,v ) do { if (s == -1) { s = v; } } while(0)
8
9
9
10
void prepare_repo_settings (struct repository * r )
10
11
{
11
- int value ;
12
+ int value , feature_many_files = 0 ;
12
13
char * strval ;
13
14
14
15
if (r -> settings .initialized )
@@ -62,6 +63,7 @@ void prepare_repo_settings(struct repository *r)
62
63
UPDATE_DEFAULT_BOOL (r -> settings .core_multi_pack_index , 1 );
63
64
64
65
if (!repo_config_get_bool (r , "feature.manyfiles" , & value ) && value ) {
66
+ feature_many_files = 1 ;
65
67
UPDATE_DEFAULT_BOOL (r -> settings .index_version , 4 );
66
68
UPDATE_DEFAULT_BOOL (r -> settings .core_untracked_cache , UNTRACKED_CACHE_WRITE );
67
69
}
@@ -70,9 +72,33 @@ void prepare_repo_settings(struct repository *r)
70
72
r -> settings .fetch_write_commit_graph = value ;
71
73
UPDATE_DEFAULT_BOOL (r -> settings .fetch_write_commit_graph , 0 );
72
74
73
- if (!repo_config_get_bool (r , "feature.experimental" , & value ) && value )
75
+ if (!repo_config_get_bool (r , "feature.experimental" , & value ) && value ) {
74
76
UPDATE_DEFAULT_BOOL (r -> settings .fetch_negotiation_algorithm , FETCH_NEGOTIATION_SKIPPING );
75
77
78
+ /*
79
+ * Force enable the builtin FSMonitor (unless the repo
80
+ * is incompatible or they've already selected it or
81
+ * the hook version). But only if they haven't
82
+ * explicitly turned it off -- so only if our config
83
+ * value is UNSET.
84
+ *
85
+ * lookup_fsmonitor_settings() and check_for_ipc() do
86
+ * not distinguish between explicitly set FALSE and
87
+ * UNSET, so we re-test for an UNSET config key here.
88
+ *
89
+ * I'm not sure I want to fix fsmonitor-settings.c to
90
+ * have more than one _DISABLED state since our usage
91
+ * here is only to support this experimental period
92
+ * (and I don't want to overload the _reason field
93
+ * because it describes incompabilities).
94
+ */
95
+ if (feature_many_files &&
96
+ fsmonitor_ipc__is_supported () &&
97
+ fsm_settings__get_mode (r ) == FSMONITOR_MODE_DISABLED &&
98
+ repo_config_get_bool (r , "core.usebuiltinfsmonitor" , & value ))
99
+ fsm_settings__set_ipc (r );
100
+ }
101
+
76
102
/* Hack for test programs like test-dump-untracked-cache */
77
103
if (ignore_untracked_cache_config )
78
104
r -> settings .core_untracked_cache = UNTRACKED_CACHE_KEEP ;
0 commit comments