Thread (581 messages) flat view 581 messages, 16 authors, 2021-10-12
STALE1809d

[PATCH v9 36/37] doc: clarify fsmonitor-watchman specification

From: Emily Shaffer <hidden>
Date: 2021-05-27 00:11:29
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

fsmonitor-watchman is not specified in the same way that other hooks
are. In fsmonitor.c:query_fsmonitor(), the path stored in
'core_fsmonitor' is executed directly via
run-command.h:capture_command(). 'core_fsmonitor' is set during 'git
update-index' via config.c:git_config_get_fsmonitor(). Neither
builtin/update-index.c, nor config.c, nor fsmonitor.c check  that the
path given is in '.git/hooks'.

None of the existing hook execution code is used by fsmonitor.c to
invoke fsmonitor-watchman, because that executable isn't expected to
reside in '.git/hooks'.

Furthermore, it doesn't make sense to specify the fsmonitor-watchman
hook more than once, and that hook itself may soon be superseded by
native logic to talk to an fsmonitor daemon directly from the Git
executable. (See [ref]
for more information.)

Therefore, let's correct the user-facing documentation around
fsmonitor-watchman and clarify that it won't be supported by
config-based hooks.

Signed-off-by: Emily Shaffer <redacted>
---
 Documentation/githooks.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index 78cc4e0872..42e66d4e2d 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -649,9 +649,12 @@ e-mails.
 fsmonitor-watchman
 ~~~~~~~~~~~~~~~~~~
 
-This hook is invoked when the configuration option `core.fsmonitor` is
-set to `.git/hooks/fsmonitor-watchman` or `.git/hooks/fsmonitor-watchmanv2`
-depending on the version of the hook to use.
+This hook is invoked when the configuration option `core.fsmonitor` is set to a
+path containing an executable. It *cannot* be specified via the usual
+`hook.fsmonitor-watchman.command` configuration or by providing an executable
+in `.git/hooks/fsmonitor-watchman`. The arguments provided to the hook are
+determined by the value of the `core.fsmonitorHookVersion` configuration
+option.
 
 Version 1 takes two arguments, a version (1) and the time in elapsed
 nanoseconds since midnight, January 1, 1970.
-- 
2.31.1.818.g46aad6cb9e-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help