Skip to content

Commit a0cc234

Browse files
committed
fixup! Merge pull request #3234 from dscho/fsmonitor-v2
In preparation for taking FSMonitor v4, let's revert the merge of v2. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 60b34f7 commit a0cc234

34 files changed

+70
-4085
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
/git-format-patch
7373
/git-fsck
7474
/git-fsck-objects
75-
/git-fsmonitor--daemon
7675
/git-gc
7776
/git-get-tar-commit-id
7877
/git-grep

Documentation/config/core.txt

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -62,50 +62,22 @@ core.protectNTFS::
6262
Defaults to `true` on Windows, and `false` elsewhere.
6363

6464
core.fsmonitor::
65-
If set, this variable contains the pathname of the "fsmonitor"
66-
hook command.
67-
+
68-
This hook command is used to identify all files that may have changed
69-
since the requested date/time. This information is used to speed up
70-
git by avoiding unnecessary scanning of files that have not changed.
71-
+
72-
See the "fsmonitor-watchman" section of linkgit:githooks[5].
73-
+
74-
Note: The value of this config setting is ignored if the (experimental)
75-
built-in file system monitor is enabled (see `core.useBuiltinFSMonitor`).
65+
If set, the value of this variable is used as a command which
66+
will identify all files that may have changed since the
67+
requested date/time. This information is used to speed up git by
68+
avoiding unnecessary processing of files that have not changed.
69+
See the "fsmonitor-watchman" section of linkgit:githooks[5].
7670

7771
core.fsmonitorHookVersion::
78-
Sets the protocol version to be used when invoking the
79-
"fsmonitor" hook.
80-
+
81-
There are currently versions 1 and 2. When this is not set,
82-
version 2 will be tried first and if it fails then version 1
83-
will be tried. Version 1 uses a timestamp as input to determine
84-
which files have changes since that time but some monitors
85-
like Watchman have race conditions when used with a timestamp.
86-
Version 2 uses an opaque string so that the monitor can return
87-
something that can be used to determine what files have changed
88-
without race conditions.
89-
+
90-
Note: The value of this config setting is ignored if the
91-
built-in file system monitor is enabled (see `core.useBuiltinFSMonitor`).
92-
93-
core.useBuiltinFSMonitor::
94-
(EXPERIMENTAL) If set to true, enable the built-in file system monitor
95-
daemon for this working directory (linkgit:git-fsmonitor--daemon[1]).
96-
+
97-
Like hook-based file system monitors, the built-in file system monitor
98-
can speed up Git commands that need to refresh the Git index
99-
(e.g. `git status`) in a working directory with many files. The
100-
built-in monitor eliminates the need to install and maintain an
101-
external third-party tool.
102-
+
103-
The built-in file system monitor is currently available only on a
104-
limited set of supported platforms. Currently, this includes Windows
105-
and MacOS.
106-
+
107-
Note: if this config setting is set to `true`, the values of
108-
`core.fsmonitor` and `core.fsmonitorHookVersion` are ignored.
72+
Sets the version of hook that is to be used when calling fsmonitor.
73+
There are currently versions 1 and 2. When this is not set,
74+
version 2 will be tried first and if it fails then version 1
75+
will be tried. Version 1 uses a timestamp as input to determine
76+
which files have changes since that time but some monitors
77+
like watchman have race conditions when used with a timestamp.
78+
Version 2 uses an opaque string so that the monitor can return
79+
something that can be used to determine what files have changed
80+
without race conditions.
10981

11082
core.trustctime::
11183
If false, the ctime differences between the index and the

Documentation/git-fsmonitor--daemon.txt

Lines changed: 0 additions & 78 deletions
This file was deleted.

Documentation/git-update-index.txt

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,7 @@ FILE SYSTEM MONITOR
498498
This feature is intended to speed up git operations for repos that have
499499
large working directories.
500500

501-
It enables git to work together with a file system monitor (see
502-
linkgit:git-fsmonitor--daemon[1]
503-
and the
501+
It enables git to work together with a file system monitor (see the
504502
"fsmonitor-watchman" section of linkgit:githooks[5]) that can
505503
inform it as to what files have been modified. This enables git to avoid
506504
having to lstat() every file to find modified files.
@@ -510,18 +508,17 @@ performance by avoiding the cost of scanning the entire working directory
510508
looking for new files.
511509

512510
If you want to enable (or disable) this feature, it is easier to use
513-
the `core.fsmonitor` or `core.useBuiltinFSMonitor` configuration
514-
variable (see linkgit:git-config[1]) than using the `--fsmonitor`
515-
option to `git update-index` in each repository, especially if you
516-
want to do so across all repositories you use, because you can set the
517-
configuration variable in your `$HOME/.gitconfig` just once and have
518-
it affect all repositories you touch.
519-
520-
When the `core.fsmonitor` or `core.useBuiltinFSMonitor` configuration
521-
variable is changed, the file system monitor is added to or removed
522-
from the index the next time a command reads the index. When
523-
`--[no-]fsmonitor` are used, the file system monitor is immediately
524-
added to or removed from the index.
511+
the `core.fsmonitor` configuration variable (see
512+
linkgit:git-config[1]) than using the `--fsmonitor` option to
513+
`git update-index` in each repository, especially if you want to do so
514+
across all repositories you use, because you can set the configuration
515+
variable in your `$HOME/.gitconfig` just once and have it affect all
516+
repositories you touch.
517+
518+
When the `core.fsmonitor` configuration variable is changed, the
519+
file system monitor is added to or removed from the index the next time
520+
a command reads the index. When `--[no-]fsmonitor` are used, the file
521+
system monitor is immediately added to or removed from the index.
525522

526523
CONFIGURATION
527524
-------------

Documentation/githooks.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,7 @@ fsmonitor-watchman
593593

594594
This hook is invoked when the configuration option `core.fsmonitor` is
595595
set to `.git/hooks/fsmonitor-watchman` or `.git/hooks/fsmonitor-watchmanv2`
596-
depending on the version of the hook to use, unless overridden via
597-
`core.useBuiltinFSMonitor` (see linkgit:git-config[1]).
596+
depending on the version of the hook to use.
598597

599598
Version 1 takes two arguments, a version (1) and the time in elapsed
600599
nanoseconds since midnight, January 1, 1970.

Makefile

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,6 @@ all::
471471
# directory, and the JSON compilation database 'compile_commands.json' will be
472472
# created at the root of the repository.
473473
#
474-
# If your platform supports a built-in fsmonitor backend, set
475-
# FSMONITOR_DAEMON_BACKEND to the "<name>" of the corresponding
476-
# `compat/fsmonitor/fsmonitor-fs-listen-<name>.c` that implements the
477-
# `fsmonitor_fs_listen__*()` routines.
478-
#
479474
# Define DEVELOPER to enable more compiler warnings. Compiler version
480475
# and family are auto detected, but could be overridden by defining
481476
# COMPILER_FEATURES (see config.mak.dev). You can still set
@@ -719,7 +714,6 @@ TEST_BUILTINS_OBJS += test-dump-split-index.o
719714
TEST_BUILTINS_OBJS += test-dump-untracked-cache.o
720715
TEST_BUILTINS_OBJS += test-example-decorate.o
721716
TEST_BUILTINS_OBJS += test-fast-rebase.o
722-
TEST_BUILTINS_OBJS += test-fsmonitor-client.o
723717
TEST_BUILTINS_OBJS += test-genrandom.o
724718
TEST_BUILTINS_OBJS += test-genzeros.o
725719
TEST_BUILTINS_OBJS += test-hash-speed.o
@@ -908,7 +902,6 @@ LIB_OBJS += fetch-pack.o
908902
LIB_OBJS += fmt-merge-msg.o
909903
LIB_OBJS += fsck.o
910904
LIB_OBJS += fsmonitor.o
911-
LIB_OBJS += fsmonitor-ipc.o
912905
LIB_OBJS += gettext.o
913906
LIB_OBJS += gpg-interface.o
914907
LIB_OBJS += graph.o
@@ -1113,7 +1106,6 @@ BUILTIN_OBJS += builtin/fmt-merge-msg.o
11131106
BUILTIN_OBJS += builtin/for-each-ref.o
11141107
BUILTIN_OBJS += builtin/for-each-repo.o
11151108
BUILTIN_OBJS += builtin/fsck.o
1116-
BUILTIN_OBJS += builtin/fsmonitor--daemon.o
11171109
BUILTIN_OBJS += builtin/gc.o
11181110
BUILTIN_OBJS += builtin/get-tar-commit-id.o
11191111
BUILTIN_OBJS += builtin/grep.o
@@ -1944,11 +1936,6 @@ ifdef NEED_ACCESS_ROOT_HANDLER
19441936
COMPAT_OBJS += compat/access.o
19451937
endif
19461938

1947-
ifdef FSMONITOR_DAEMON_BACKEND
1948-
COMPAT_CFLAGS += -DHAVE_FSMONITOR_DAEMON_BACKEND
1949-
COMPAT_OBJS += compat/fsmonitor/fsmonitor-fs-listen-$(FSMONITOR_DAEMON_BACKEND).o
1950-
endif
1951-
19521939
ifeq ($(TCLTK_PATH),)
19531940
NO_TCLTK = NoThanks
19541941
endif
@@ -2830,9 +2817,6 @@ GIT-BUILD-OPTIONS: FORCE
28302817
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
28312818
@echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
28322819
@echo X=\'$(X)\' >>$@+
2833-
ifdef FSMONITOR_DAEMON_BACKEND
2834-
@echo FSMONITOR_DAEMON_BACKEND=\''$(subst ','\'',$(subst ','\'',$(FSMONITOR_DAEMON_BACKEND)))'\' >>$@+
2835-
endif
28362820
ifdef TEST_OUTPUT_DIRECTORY
28372821
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
28382822
endif

builtin.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix);
159159
int cmd_for_each_repo(int argc, const char **argv, const char *prefix);
160160
int cmd_format_patch(int argc, const char **argv, const char *prefix);
161161
int cmd_fsck(int argc, const char **argv, const char *prefix);
162-
int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix);
163162
int cmd_gc(int argc, const char **argv, const char *prefix);
164163
int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix);
165164
int cmd_grep(int argc, const char **argv, const char *prefix);

0 commit comments

Comments
 (0)