Skip to content

enhance: do not refresh local changes for files written into ignored directories - #2873

Open
bertyhell wants to merge 1 commit into
sourcegit-scm:developfrom
bertyhell:perf/watcher-skip-build-dirs
Open

bertyhell wants to merge 1 commit into
sourcegit-scm:developfrom
bertyhell:perf/watcher-skip-build-dirs

Conversation

@bertyhell

Copy link
Copy Markdown

Builds write continuously into ignored output folders (bin/, obj/,
node_modules/, target/...), and each of these writes scheduled a full
git status, although such changes can never appear in it.

The watcher now asks git (status --ignored=matching) which directories are
entirely ignored and skips the events under them. The list is queried lazily,
dropped when the index, a .gitignore or info/exclude changes (tracked files
or ignore rules may have changed), and queried again when a new directory is
created (the output folder of a first build, for example).

The result of IsInSubmodule is also cached per directory instead of probing
the file system up to the root for every event. The cache is cleared when
.gitmodules or a nested .git changes.

🤖 Generated with Claude Code

…directories

Builds write continuously into ignored output folders (`bin/`, `obj/`,
`node_modules/`, `target/`...), and each of these writes scheduled a full
`git status`, although such changes can never appear in it.

The watcher now asks git (`status --ignored=matching`) which directories are
entirely ignored and skips the events under them. The list is queried lazily,
dropped when the index, a `.gitignore` or `info/exclude` changes (tracked files
or ignore rules may have changed), and queried again when a new directory is
created (the output folder of a first build, for example).

The result of `IsInSubmodule` is also cached per directory instead of probing
the file system up to the root for every event. The cache is cleared when
`.gitmodules` or a nested `.git` changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KCxH1zwDXLd9kfAAkcf6PZ

This branch has not been deployed

No deployments
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.

2 participants