git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <derrickstolee@github.com>
To: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>,
	Git Community <git@vger.kernel.org>
Subject: Re: Issue when using the fsmonitor-watchman hook?
Date: Mon, 11 Apr 2022 09:46:24 -0400	[thread overview]
Message-ID: <edea2223-a9e1-c026-089f-80ea36cf97c2@github.com> (raw)
In-Reply-To: <3ce82619-6305-69b6-b4e5-bbbc91c17530@gmail.com>

On 4/10/2022 2:21 PM, Kaartic Sivaraam wrote:
> Hi all,

Hi Kaartic,
 
> I recently installed v2.36.0-rc1 and started getting the warning about
> the deprecation of core.useBuiltinFSMonitor configuration. It appeared
> for each 'git' invocation which was a bit annoying. Fortunately, I had
> some spare time so I went the route of actually applying the suggested
> alternative rather than suppressing the warning.

So, the new alternative is to set core.fsmonitor=true, which continues
to use the builtin FS Monitor. What advice did you see that was
different?

(Also, this thread will only apply to Git for Windows, since core Git
did not include core.useBuiltinFSMonitor. Feel free to move this
discussion to [1] if you'd rather talk there.)

[1] https://github.com/git-for-windows/git/discussions/3251

Hopefully using core.fsmonitor=true solves your issue.

---

If you really want to use the Watchman-based hook solution, then
here's the rest of my response:

> According to the git-hooks documentation, I configured core.fsmonitor
> to '.git/hooks/fsmonitor-watchman' and after that for some reason all
> the styles in the terminal seems to have gone awry (I use Windows
> Terminal with PowerShell 7). A sample demonstration.

The hooks documentation will only discuss the external hook-based
FS Monitor, not the builtin one, so you are changing your behavior
here.
> Also, I got the following error messages when running 'git status'
> 
>> git status
> open2: exec of watchman -j --no-pretty failed: No such file or directory at .git/hooks/fsmonitor-watchman line 78.

> It's clear that I'm doing something wrong. I'm not sure what, though.
> The fact that I have no clear idea about what the fsmonitor-watchman
> hook does, does not help at all. It would be great if someone could
> help me understand what I got wrong :)

The .git/hooks/ directory is populated when your repository is
created. That hook might not have existed in your installed templates
when your repo was initialized.

Further, the default name is "fsmonitor-watchman.sample" and you need
to change the name (after inspecting the script to ensure it is not
malicious). You can also find the latest copy in a more protected
place: C:\Program Files\Git\mingw64\share\git-core\templates\hooks

The .NET version of Scalar used to update the hook from this
protected directory on upgrade. With the builtin mechanism, such
efforts are not necessary.

Thanks,
-Stolee

  reply	other threads:[~2022-04-11 13:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-10 18:21 Issue when using the fsmonitor-watchman hook? Kaartic Sivaraam
2022-04-11 13:46 ` Derrick Stolee [this message]
2022-04-12 19:27   ` Kaartic Sivaraam

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=edea2223-a9e1-c026-089f-80ea36cf97c2@github.com \
    --to=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=kaartic.sivaraam@gmail.com \
    /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).