fix(rg): preserve default binary-match reporting for explicit inputs#1756
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | a210074 | Commit Preview URL | May 25 2026, 04:34 PM |
Verify default-mode 'binary file matches ...' reporting: - explicit binary file argument - binary stdin Main already implements input.explicit handling differently than the original PR proposed (using a bool field rather than skip_binary_by_default); the meaningful contribution is the regression coverage. Rebased on current main; original PR #1756 by chaliy (refactor portion superseded by #1737).
3016384 to
a210074
Compare
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.
Motivation
(filename, content)tuples, losing provenance and causing false negatives for explicit files and stdin.binary file matches ...by default.Description
RgSearchInputwith fieldsfilename,content, andskip_binary_by_defaultand replaceVec<(String,String)>withVec<RgSearchInput>forRgCollectedInputsto preserve input provenance (crates/bashkit/src/builtins/rg/mod.rs).RgSearchInput::explicit(...)(no default skip) and mark recursively discovered/indexed files withRgSearchInput::recursive(...)(default-skip enabled).input.skip_binary_by_defaultwhen deciding whether a NUL-containing input should be silently skipped, so explicit inputs and stdin produce ripgrep-style binary summaries by default.test_rg_binary_text_modesto cover explicit binary file argument and binary stdin behavior under default mode.Testing
cargo test -p bashkit test_rg_binary_text_modes, which passed (1 passed; 0 failed).test_rg_binary_text_modesnow includes assertions for explicit binary path and binary stdin and these assertions succeeded.Codex Task