[RFE] First trigger invocation lists all files, optionally turn this behavior off
- Dominant language
- C++
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
I understand watchman's primary purpose is to integrate into a build chain.
However, I've also found it quite well suited to other types of use cases: e.g. notifying users of changes in shared directories, if the `settle` time is sufficiently large (1-5 minutes).
I would understand if the authors don't wish to extend watchman's functionality to cover use cases other than the one originally intended, but the one gap I currently have for this use case is that when watchman is restarted, or a watch is deleted and re-added, the first trigger invocation happens after the settle time has passed, and includes every file in the watch. When the settle time is much longer than one would use for a build chain e.g. measured in minutes this behavior doesn't make sense.
It is simple to ignore the first invocation by checking the value of `WATCHMAN_SINCE` but this will cause any changes before the first invocation to be lost. So I think the simplest way to solve this would be an option to support immediate trigger invocation on creation, ignoring `settle`, so that my handler can ignore that first invocation.
Alternately, an option to directly configure watchman to return only changes since start on the first trigger invocation would work also.
Contributor guide
Assessment
This issue has not been assessed yet.