fix(rg): honor include filters for hidden files#2049
Closed
chaliy wants to merge 1 commit into
Closed
Conversation
There was a problem hiding this comment.
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
rgdiscovery 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; | ||
| } |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | a9fd8aa | Commit Preview URL | Jun 12 2026, 01:40 AM |
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.
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.
Superseded by #2061 — rebased cleanly on main.