-
Notifications
You must be signed in to change notification settings - Fork 371
fix: prevent glob searches from surfacing ignored files #1245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+1,517
−43
Closed
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8cbeef1
fix: respect ignore files in glob
morluto 3fc6b3a
chore: add glob ignore changeset
morluto f01f7b4
fix: filter glob patterns in-process to respect ignore files
morluto 41ecf63
fix: harden glob in-process filtering against cap, case, and malforme…
morluto 6f17610
fix: handle rooted globs, multibyte streaming, bracket braces, Window…
morluto a600edb
perf: compile glob matcher once per search instead of per line
morluto d810f4e
fix: preserve root anchoring for leading-slash basename globs
morluto 248855a
fix: accept bracket escapes, disable picomatch extglob/range braces, …
morluto 71c9af3
fix: harden glob search path, extglob/range escaping, and pattern val…
morluto daf4970
fix: preserve braces in char classes, drop empty alternatives, treat …
morluto e7c8070
Merge branch 'main' into fix/glob-ignore-files
morluto f7d0f50
fix: escape POSIX classes, extglob in char classes, bare parens, nega…
morluto ea6426c
fix: preserve leading ! exclusion globs and escaped comma brace arms
morluto 3b60ca9
fix(agent-core): align glob filtering with gitignore syntax
morluto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Fix glob file searches so all patterns continue to respect ignore files. A positive ripgrep `--glob` always overrides ignore logic, so any non-broad user pattern (e.g. `*.ts`, `dist/**/*.js`) could re-include files excluded by `.gitignore`. The pattern is now filtered in-process after `rg --files` enumerates non-ignored 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the pattern starts with
#, ripgrep applies.gitignoreparsing first (rg --helpsays--globuses.gitignoreglobs), so a commented glob like#[is ignored and behaves like a broad search; I checkedrg --files -g '#['returns the normal file list. This validation runs on the raw pattern beforepreprocessGitignoreGlobPattern, so the same input is rejected as an unclosed character class instead of searching, even though the later matcher already treats#...as broad. Skip validation for comment globs or validate the preprocessed form.Useful? React with 👍 / 👎.