Live data from Hacker News

Watchman: Execute a command when something changes

github.com

71–80 of 98 posts

Re: Watchman: Execute a command when something changes

#71
I haven't seen anybody here mention that you can do this with systemd path units [0],[1].

I know not everybody uses Linux (or loves systemd as much as I do) but it's a great solution if you already use systemd.

[0] https://www.redhat.com/sysadmin/introduction-path-units

[1] https://www.freedesktop.org/software/systemd/man/systemd.pat...

Re: Watchman: Execute a command when something changes

#74
post #3

Not to be confused with Facebook’s file watch daemon, also names watchman, which does the same sort of thing but is more complicated. There’s a bunch of tools that integrate Facebook’s watchman for more efficient change tracking. Advantages of Facebook’s watchman: 1. Implements efficient file system event watches on macOS and Windows 2. IPC/daemon system reduces resource use because overlapping watches/triggers don’t…

Also not to be confused with watchdog and it's command watchmedo, which is what I thought this was when I first read the headline. I don't know what the differences are, but I use watchdog to restart my local celery workers when I make changes. It's scripted out so I don't ever use the command directly. https://pypi.org/project/watchdog/ https://github.com/gorakhargosh/watchdog EDIT: Now I'm wondering how often I mis…

Also not to be confused with watchexec (my tool of choice for executing commands on file changes):

https://github.com/watchexec/watchexec

Re: Watchman: Execute a command when something changes

#75
Inotify can drop events when there is a burst of file changes. You can bump up the max number of queued events though. For example, if you're watching a git repo and switch to an old branch that has 1500+ changed files then inotify will likely miss some with a default configuration.

Re: Watchman: Execute a command when something changes

#76
post #49

I've been using fswatch to great effect. The big advantage is that it's truly cross-platform, falling back to polling if no fs notification system is available as long as stat(2) works. Very composable as you just pipe its output to whatever you want (typically a while read do end), so exclusion is a awk/sed/perl/grep/rg away, and command can be as simple or complex as it needs to while the tool itself stays lean. Co…

> If you are installing fswatch using a package manager and you would like the PDF manual to be bundled into the package, please send a feature request to the package maintainer.

I can't find the PDF manual in the repo. Do I need to contact the author and say please?

Re: Watchman: Execute a command when something changes

#77
post #3

Not to be confused with Facebook’s file watch daemon, also names watchman, which does the same sort of thing but is more complicated. There’s a bunch of tools that integrate Facebook’s watchman for more efficient change tracking. Advantages of Facebook’s watchman: 1. Implements efficient file system event watches on macOS and Windows 2. IPC/daemon system reduces resource use because overlapping watches/triggers don’t…

Alternately, Facebook's project is not to be confused with this significantly older one.

Both projects are from around 2014.

Re: Watchman: Execute a command when something changes

#79

this project hasn't had a commit in 8 years and only has a handful of stars. It confusingly shares the name with a much more popular tool from Meta—though the use case is slightly different. There are other much more popular tools that do the same thing, like entr, watchexec, and nodemon. Why is this posted?

Small correction: watchman is a tool made and released by Facebook, not made and released by Meta.

(yes, one owns the other, but Facebook employees writing and releasing code for Facebook are on Facebook's payroll, not Meta's payroll)

Re: Watchman: Execute a command when something changes

#80

this project hasn't had a commit in 8 years and only has a handful of stars. It confusingly shares the name with a much more popular tool from Meta—though the use case is slightly different. There are other much more popular tools that do the same thing, like entr, watchexec, and nodemon. Why is this posted?

Small correction: watchman is a tool made and released by Facebook, not made and released by Meta. (yes, one owns the other, but Facebook employees writing and releasing code for Facebook are on Facebook's payroll, not Meta's payroll)

No, there is no such thing as “Facebook’s Payroll”. It’s all Meta. I’m a former Meta employee. Watchman is used heavily across the family of apps. It’s not like Alphabet that’s a holding company for different smaller companies.

Watchman not yet being branded with “Meta” is a case of laziness. It doesn’t indicate it’s limited to the Blue app.

Post reply on HN