fix(rg): positive globs and type includes unhide hidden files but not hidden directories#2061
Merged
Conversation
… hidden directories
There was a problem hiding this comment.
Pull request overview
This PR adjusts rg file discovery/filtering so that hidden files can be searched when they match a positive --glob include or --type include, even without --hidden, while hidden directories remain excluded unless --hidden is set—aligning behavior with ripgrep.
Changes:
- Add helper methods on
RgOptionsto detect whether a hidden file is explicitly allowed by positive glob/type includes. - Update recursive filesystem walk to skip hidden directories but conditionally allow hidden files when explicitly included.
- Update indexed-search hidden filtering logic and add regression tests for recursive and indexed modes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 43bb33a | Commit Preview URL Branch Preview URL |
Jun 12 2026, 10:14 AM |
Replace Vec component collection with a Peekable iterator. Uses peek().is_none() to detect whether a hidden component is the final segment (file, may be allowed) vs intermediate (directory, excluded).
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.
Closes #2049
A positive
--globpattern or--typeinclude that explicitly names a hidden file should let that file be visited even without--hidden, matching ripgrep's behaviour. Hidden directories remain excluded unless--hiddenis set.