Skip to content

Don't rescan for writes in git-ignored folders - #83

Merged
rocketraman merged 2 commits into
masterfrom
claude/gitvantage-ignored-watch
Nov 4, 2026
Merged

rocketraman merged 2 commits into
masterfrom
claude/gitvantage-ignored-watch

Conversation

@rocketraman

Copy link
Copy Markdown
Owner

Two follow-ups from the 1.6.1 diagnostics report on Apple Silicon.

Don't rescan for writes in git-ignored folders

In the report, one repo's build/ was behind 97% of its file events (28,488 events) and caused 224 rescans, about half of all the rescans the app made. While a build runs, the debounce ceiling rescans the repo every 5s, and git sees none of those changes.

  • WatchRoots.ignoredDirs asks git which top-level folders are ignored (check-ignore). It leaves out any folder that still has tracked files in it (ls-files), and never asks about .git.
  • WatchPolicy.actionFor drops an event only when all of its paths are inside one of those folders. These still trigger a rescan:
    • the folder itself being created or deleted;
    • files at the top of the repo;
    • a move from build/ into the code;
    • the watcher's lost-events signal.
  • The answer is fetched once when a repo is registered. It is fetched again in the background when an event lands in a top-level folder that wasn't there last time, or when .gitignore or .git/info/exclude changes. Until it refreshes, nothing extra is dropped, so a stale answer costs a rescan and never hides a change.
  • The folders are still watched. Not watching them at all stays blocked on Nucleus#571.
  • Not covered: ignored folders below the top level (app/build/), and changes to the global excludes file before the repo is next registered.

Say allocation is unavailable when every counter reads 0

The native image reports per-thread allocation counters as supported, then reads 0 for every thread. The report showed allocated 0MB since start next to 218 young collections. It now reads alloc unavailable (this runtime's per-thread counters all read 0).

Testing

  • 12 new tests:
    • git-backed: ignored vs tracked-in-ignored folders, .git, a folder that isn't a repo;
    • pure policy: drop vs rescan edges, and when the answer goes stale.
  • Unit tests 289/289, Konture 10/10, detekt clean.
  • Not yet run in the app against a live build.

A build writes thousands of files into build/, and while it runs the
debounce ceiling rescans the repo every five seconds for nothing git can
see. One field report had a single repo's build/ behind 97% of its
events and half of every rescan the app made.

Events wholly inside a top-level folder git ignores, and holds nothing
tracked in, are now dropped. The folders are still watched; not watching
them stays blocked on Nucleus#571.

Signed-off-by: Raman Gupta <rocketraman@gmail.com>
…ads 0

The native image reports per-thread allocation counters as supported and
then reads 0 for every thread, so the report showed "allocated 0MB"
beside hundreds of young collections.

Signed-off-by: Raman Gupta <rocketraman@gmail.com>
@rocketraman
rocketraman force-pushed the claude/gitvantage-ignored-watch branch from 02ddd52 to a0c0449 Compare November 4, 2026 14:28
@rocketraman
rocketraman merged commit 5a81e98 into master Nov 4, 2026
2 checks passed
@rocketraman
rocketraman deleted the claude/gitvantage-ignored-watch branch November 4, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant