Skip to content

Commit 54c20e3

Browse files
jeffhostetlerGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Merge branch 'mark-v4-fsmonitor-experimental' into try-v4-fsmonitor
2 parents 7d09b41 + 441a23b commit 54c20e3

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

Documentation/config/core.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ git by avoiding unnecessary scanning of files that have not changed.
7171
+
7272
See the "fsmonitor-watchman" section of linkgit:githooks[5].
7373
+
74-
Note: The value of this config setting is ignored if the
74+
Note: The value of this config setting is ignored if the (experimental)
7575
built-in file system monitor is enabled (see `core.useBuiltinFSMonitor`).
7676

7777
core.fsmonitorHookVersion::
@@ -91,7 +91,7 @@ Note: The value of this config setting is ignored if the
9191
built-in file system monitor is enabled (see `core.useBuiltinFSMonitor`).
9292

9393
core.useBuiltinFSMonitor::
94-
If set to true, enable the built-in file system monitor
94+
(EXPERIMENTAL) If set to true, enable the built-in file system monitor
9595
daemon for this working directory (linkgit:git-fsmonitor--daemon[1]).
9696
+
9797
Like hook-based file system monitors, the built-in file system monitor

Documentation/git-fsmonitor--daemon.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ git-fsmonitor--daemon(1)
33

44
NAME
55
----
6-
git-fsmonitor--daemon - A Built-in File System Monitor
6+
git-fsmonitor--daemon - (EXPERIMENTAL) A Built-in File System Monitor
77

88
SYNOPSIS
99
--------
@@ -16,6 +16,9 @@ SYNOPSIS
1616
DESCRIPTION
1717
-----------
1818

19+
NOTE! This command is still only an experiment, subject to change dramatically
20+
(or even to be abandoned).
21+
1922
A daemon to watch the working directory for file and directory
2023
changes using platform-specific file system notification facilities.
2124

repo-settings.c

Lines changed: 25 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)
@@ -33,6 +34,29 @@ void prepare_repo_settings(struct repository *r)
3334
/* Defaults modified by feature.* */
3435
if (experimental) {
3536
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);
3660
}
3761
if (manyfiles) {
3862
r->settings.index_version = 4;

0 commit comments

Comments
 (0)