Skip to content

fix(rg): honor include filters for hidden files#2049

Closed
chaliy wants to merge 1 commit into
mainfrom
2026-06-12-propose-fix-for-hidden-file-filtering-issue
Closed

fix(rg): honor include filters for hidden files#2049
chaliy wants to merge 1 commit into
mainfrom
2026-06-12-propose-fix-for-hidden-file-filtering-issue

Conversation

@chaliy

@chaliy chaliy commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Superseded by #2061 — rebased cleanly on main.

Copilot AI review requested due to automatic review settings June 12, 2026 01:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts bashkit’s rg implementation to better match ripgrep’s behavior around hidden files: dot-prefixed files can be surfaced when explicitly included by positive -g glob or -t type includes, while hidden directories remain pruned unless --hidden is set. It also includes related safety/robustness fixes in interpreter cancellation state reconciliation and in the Python VFS glob API to bound traversal and respect timeouts.

Changes:

  • Update recursive and indexed rg discovery to allow explicitly-included hidden files while still excluding hidden directories by default.
  • Add regression tests covering recursive glob includes, recursive type includes, and indexed glob includes for hidden-file behavior.
  • Improve interpreter cancellation cleanup (preserve function_depth) and bound Python direct VFS glob traversal via budget + timeout, with Python tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/bashkit/src/interpreter/mod.rs Preserve function_depth when reconciling cancelled execution state; add regression test.
crates/bashkit/src/builtins/rg/mod.rs Implement hidden-file allowlist semantics for recursive and indexed search; add tests.
crates/bashkit-python/tests/test_vfs.py Register new Python VFS glob regression tests.
crates/bashkit-python/tests/_bashkit_categories.py Add tests asserting RealFs glob traversal is budget/timeout bounded.
crates/bashkit-python/src/lib.rs Add timeout + traversal budget to direct VFS globbing implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3910 to +3914
let components: Vec<_> = path
.strip_prefix(root)
.unwrap_or(path)
.components()
.any(|component| component.as_os_str().to_str().is_some_and(is_hidden_name))
.collect();
Comment on lines +1236 to +1240
for entry in entries {
visited_entries += 1;
if visited_entries > GLOB_MAX_VISITED_ENTRIES {
return matches;
}
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit a9fd8aa Commit Preview URL Jun 12 2026, 01:40 AM

@chaliy chaliy closed this Jun 12, 2026
chaliy added a commit that referenced this pull request Jun 12, 2026
… hidden directories

Closes #2049

A positive --glob pattern or --type include that explicitly names a hidden file should let that file be visited even without --hidden, matching ripgrep's behaviour. Hidden directories remain excluded unless --hidden is set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants