Repository navigation
Stop rejecting .svg and .raw by extension - #135
Merged
Shengyu Fu (shengyfu) merged 1 commit intoSep 5, 2026
Merged
Conversation
The walk rejects a list of binary extensions before reading file contents. Two entries on that list cost matches ripgrep finds. filetypes.rs defines `svg` as a builtin file type, so `tgrep -t svg needle .` cannot match while `rg -t svg needle .` does. Remove those two entries. The remaining 65 extensions are still rejected on traversal, and a binary `.raw` stays invisible on traversal, matching rg 15.2.0.
Copilot started reviewing on behalf of
Misha Kolesnik (tenequm)
September 4, 2026 20:27
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes have regression coverage and no unresolved issues.
Pull request overview
Removes extension-only rejection of SVG and RAW files so content determines binary status.
Changes:
- Allows
.svgand.rawfiles through traversal. - Adds indexed and brute-force regression coverage.
File summaries
| File | Description |
|---|---|
tgrep-core/src/walker.rs |
Removes SVG and RAW from binary-extension filtering. |
tgrep-cli/tests/ripgrep_parity.rs |
Tests content classification and ripgrep parity. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Shengyu Fu (shengyfu)
approved these changes
Sep 5, 2026
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.
The walk rejects a list of binary extensions before reading file contents.
filetypes.rsdefinessvgas a builtin file type, sotgrep -t svg needle .cannot match while
rg -t svg needle .does. This removes.svgand.rawfrom that list. The other 65 entries are still rejected on traversal.
svg_and_raw_are_classified_by_content_on_both_search_pathsintgrep-cli/tests/ripgrep_parity.rspins this on the indexed and brute-forcepaths, and includes a
.rawfixture containing a NUL that stays invisible ontraversal. Behaviour was compared against rg 15.2.0.