glob: stop ripgrep when results sufficient and ignore heavy dirs#5266
Open
ry2009 wants to merge 4 commits intoanomalyco:devfrom
Open
glob: stop ripgrep when results sufficient and ignore heavy dirs#5266ry2009 wants to merge 4 commits intoanomalyco:devfrom
ry2009 wants to merge 4 commits intoanomalyco:devfrom
Conversation
Contributor
ry2009
commented
Dec 9, 2025
- Ripgrep file listing now stops the underlying rg --files process when consumers exit early (e.g., after hitting the 100-result cap), preventing full-tree scans from pegging CPU.
- Glob tool now ignores common heavy directories by default (node_modules, .venv, .direnv, .cache, dist, build, out, .next, target, coverage, tmp, temp, pycache), reducing work for typical searches.
rekram1-node
reviewed
Dec 9, 2025
Comment on lines
8
to
21
| const DEFAULT_IGNORE = [ | ||
| "**/node_modules/**", | ||
| "**/.venv/**", | ||
| "**/.direnv/**", | ||
| "**/.cache/**", | ||
| "**/dist/**", | ||
| "**/build/**", | ||
| "**/out/**", | ||
| "**/.next/**", | ||
| "**/target/**", | ||
| "**/coverage/**", | ||
| "**/tmp/**", | ||
| "**/temp/**", | ||
| "**/__pycache__/**", |
Collaborator
There was a problem hiding this comment.
ripgrep automatically respects gitignore which should have these typically
Contributor
Author
There was a problem hiding this comment.
good catch the main mitigation win here is early-stop/kill behavior but some of these are not standard unignored caches in .gitignore & sometimes some people have no .git present
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
|
This is cursed. See this comment for explanation. |
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.