vcs-watch
Filesystem-watch a git or jj repository and stream typed state-change events. Part of the vcs-toolkit-rs workspace.
Built on vcs-core: on each filesystem
change vcs-watch debounces the burst, re-queries the repo's batched snapshot,
and diffs it against the previous state — so noise (git's ref temp-renames,
index.lock, reflog churn) coalesces into one re-check instead of being mis-read
as events. The foundation for prompts, status bars, TUIs, and daemons.
📖 Full guide: on docs.rs
use Repo;
use ;
# async
Each settled change is a RepoChange { snapshot, events } — the new full state
and the typed deltas. Configure the scope and timing with the builder:
# use Duration;
# use Repo;
# use RepoWatcher;
# async
Runtime: unlike the rest of the toolkit (which hides tokio behind
processkit), vcs-watch uses tokio at runtime — build and await it inside a
tokio runtime. It watches .git/.jj (jj wins when colocated) by default;
working_tree(true) adds the working tree.
License
MIT