Repository navigation
Watch only the directories the gitignore-honoring scan enters - #1775
Merged
Merged
Conversation
… a .gitignore edit
…nore change The watch walk now applies the startup scan's gitignore rules, including the exemption for paths a glob spells out. A .gitignore written, created or deleted while watching re-walks its directory, watches the directories it un-ignores and indexes their files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1768
The watch walk skips the same directories as the startup scan. It applies the same
.gitignorerules, and it keeps the exemption for paths a glob spells out, including directories created later. When a.gitignoreis written, created or deleted while watching, its directory is re-walked. Directories it newly un-ignores get watches, and on Linux their existing files are indexed. Watches already on directories that become ignored stay in place, because the live filter drops their events. The live filter's missing exemption is #1774 and is out of scope here.Platform note: macOS and Windows use one recursive watch, and BSD's notify backend only adds watches. On those platforms the files already in an un-ignored directory are not indexed until the next build. Files written there afterwards are indexed, as they are today.
Red
Red commit
15d04a6d, CI job 135285717989 (Integration tests):scan_dirs_leaves_out_a_gitignored_directory_a_glob_reachespanicked: left[root, root/build, root/build/sub, root/docs], right[root, root/docs].Manual exercise
dirsql server -c .dirsql.tomlon a repo with.gitignore=build/, 200 directories underbuild/, and a table with glob**/*.json. Watch counts come from/proc/<pid>/fdinfo, unique watches:.gitignorebuild/d1after the un-ignorebuild/d2afterwardsE2E Verification
cargo test --workspace --features clipasses, exceptnon_utf8_namesandnon_utf8_names_e2e. The local filesystem rejects non-UTF-8 file names (EILSEQ), the same on main.packages/python/e2e-attestations/<branch>.jsonreceipt writtenpackages/ts/e2e-attestations/<branch>.jsonreceipt writtentesting-conventions e2e attest 'uv run python -m pytest tests/e2e/watch_fault_test.py tests/e2e/fanout_test.py tests/e2e/fresh_declared_repros_test.py tests/e2e/glob_speed_gitignore_test.py tests/e2e/watch_speed_test.py -x -q'(aftermaturin develop --releaseand a release CLI build);just e2e-attest-tsChangelog / Migrations
packages/rust/changelog.d/packages/rust/migrations.d/