Skip to content

Bound diff watches to Git-tracked directories - #40

Merged
domenkozar merged 1 commit into
mainfrom
fix/bound-diff-watches
Oct 20, 2026
Merged

domenkozar merged 1 commit into
mainfrom
fix/bound-diff-watches

Conversation

@domenkozar

Copy link
Copy Markdown
Member

Recursive checkout watching follows directory symlinks into ignored dependency trees such as .devenv/profile, accumulating millions of directory-watch records. A captured desktop run reached 8.5 GiB RSS.

Build the watch list from gix's index and register nonrecursive watches for tracked-file parent directories and Git metadata. Filter unrelated file events, and rebuild the watch list when the index, refs, or tracked directory structure changes. Tracked files remain monitored even when an ignore rule matches them. Directory symlinks are not traversed. Diff contents continue to come from gix status, with untracked files excluded as before.

Validation

  • Workspace tests: 156 passed, 1 ignored. Includes ignored trees, tracked files under ignored directories, index changes, recreated directories, linked worktrees, and symlinks.
  • Clippy with warnings denied, formatting checks, and release build passed.
  • On the affected checkout, the desktop held 162 total inotify watches and about 169 MiB RSS during a 60-second sample, with the checked dependency-tree directory inodes absent from watch registrations.
  • After 100 watcher creation/drop cycles, the isolated probe remained around 9 MiB RSS and left zero inotify registrations.

Runtime verification was on Linux and covers short samples, not a multi-hour memory plateau.

@domenkozar
domenkozar merged commit c9bc3f9 into main Oct 20, 2026
13 checks passed
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