Big Borther
bigbrother crate is an async Git-aware file tracker for Rust that watches a working directory and reports files that are currently trackable by ignore rules.
- High-level API.
- Git-aware file watching.
.gitignoreand.ignoresupport across hierarchy, including parent directories.- Global Git ignore support (
core.excludesFile). - Per-file transitions when ignore rules change.
- Async API via
tokiochannel. - Optional source-only mode (
source-filterfeature) that only tracks source files based ontokeilanguage definitions.
It combines:
notifyfor filesystem watching.ignorefor fast parallel file discovery.ignore-filesfor discovering and compiling ignore files (.gitignore,.ignore, global git excludes).- Optional
tokeisupport for source-only filtering
Installation
To add bigbrother to your project, install it with cargo add:
To enable source-only filtering (only_source option), use the source-filter feature:
How it works
Here's a high-level overview of how Big Brother works:
- Resolves cwd and (if present) containing git repo root.
- If cwd is inside a repo, watches the repo root to catch parent ignore changes.
- Builds ignore state from local + global ignore sources.
- Performs an initial parallel scan, then emits InitialTracked events.
- Processes live filesystem events (
Created,Changed,Removed,Moved) for tracked files. - On ignore-file updates, rescans and diffs tracked state to emit
Tracked/Untracked.
Usage
Basic usage:
use ;
async
If you only care about source files, enable the source-filter feature and set the only_source option:
use ;
async
Changelog
See the changelog.