git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: Emily Shaffer <emilyshaffer@google.com>, Git List <git@vger.kernel.org>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Jonathan Tan <jonathantanmy@google.com>,
	Kevin Willford <Kevin.Willford@microsoft.com>,
	Derrick Stolee <dstolee@microsoft.com>,
	Jeff Hostetler <jeffhost@microsoft.com>,
	Jeff King <peff@peff.net>
Subject: Re: What to do with fsmonitor-watchman hook and config-based hooks?
Date: Thu, 11 Mar 2021 14:23:03 -0500	[thread overview]
Message-ID: <33a12a7a-d19c-63b8-f21e-db7e517b0f53@gmail.com> (raw)
In-Reply-To: <CAJoAoZk0fSyPSJZ51wNv4XujPA_-hPfh8eMRQPbyeTXFvKJ9+Q@mail.gmail.com>

On 3/11/2021 1:42 PM, Emily Shaffer wrote:
> Hi folks, I grabbed a bunch of CC from 'git blame fsmonitor.c' so
> sorry if you don't care about fsmonitor-watchman anymore... :) Note
> that this whole conversation has to do with the series proposed at
> https://lore.kernel.org/git/20210311021037.3001235-1-emilyshaffer@google.com.
> 
> When I was looking through the remaining hooks in
> Documentation/githooks.txt I noticed that the fsmonitor-watchman hook
> is implemented somewhat differently than most other hooks. As I
> understand it, to use that hook someone needs to:
> 
> 1. Configure core.fsmonitor with a path to some fsmonitor-watchman
> hook. The documentation in 'Documentation/githooks.txt' claims that it
> needs to point to '.git/hooks/fsmonitor-watchman' or
> '.git/hooks/fsmonitor-watchmanv2', but I don't see that constraint
> enforced when the config is read (config.c:git_config_get_fsmonitor()
> and fsmonitor.c:query_fsmonitor()), so it seems that core.fsmonitor
> can point to wherever it wants. (Plus
> 'templates/blt/hooks/fsmonitor-watchman.sample' suggests setting
> 'core.fsmonitor' = '.git/hooks/query-watchman'...)
> 2. Configure core.fsmonitorhookversion to 1 or 2, to indicate the arg
> structure for the executable specified in core.fsmonitor.

This is correct.

> Because the executable doesn't necessarily live in .git/hooks/,
> fsmonitor.c:query_fsmonitor() completely skips the "API" for running
> hooks (run-command.h:run_hook_le()) and just uses
> run-command.h:capture_command() directly.
> 
> Interestingly, this is really similar to the way config-based hooks
> (https://lore.kernel.org/git/20210311021037.3001235-1-emilyshaffer@google.com)
> work - but different enough that I think it may be awkward to
> transition fsmonitor-watchman to work like everything else. So, some
> questions, plus a proposal:

You'll want to get Jeff Hostetler's perspective first, but I'm of
the opinion that we'll want to stop recommending the Watchman hook
when the Git-native FS Monitor feature lands, with some time to
let things release and simmer before we remove the core.fsmonitor
config option. We would also need a Linux implementation, but that
is planned.

If we think that the plan of "eventually, FS Monitor won't use hooks"
is reasonable, then how much do you want to spend time unifying it
with your config-based hooks? Can they live together temporarily?

(Naturally, deprecating FS Monitor through the hook might not be
a reasonable plan.)

Thanks,
-Stolee

  reply	other threads:[~2021-03-11 19:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 18:42 What to do with fsmonitor-watchman hook and config-based hooks? Emily Shaffer
2021-03-11 19:23 ` Derrick Stolee [this message]
2021-03-11 19:36   ` Emily Shaffer
2021-03-12 16:51     ` Jeff Hostetler
2021-03-12 18:33       ` Ævar Arnfjörð Bjarmason
2021-03-12 20:33       ` Emily Shaffer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33a12a7a-d19c-63b8-f21e-db7e517b0f53@gmail.com \
    --to=stolee@gmail.com \
    --cc=Kevin.Willford@microsoft.com \
    --cc=dstolee@microsoft.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=jeffhost@microsoft.com \
    --cc=jonathantanmy@google.com \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).