fix(rg): preserve collected diagnostics in quiet match paths#1755
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 0ea13c3 | Commit Preview URL | May 25 2026, 04:33 PM |
collect_rg_inputs accumulates read errors into collected_inputs.stderr, but quiet early-return paths used ExecResult::ok which dropped those diagnostics, causing 'rg -q needle missing.txt readable.txt' to lose missing-file messages when --messages is enabled. Thread stderr through rg_quiet_result so the quiet selected paths preserve collected diagnostics. Adds two differential cases: - -q with missing file + readable match - --no-messages -q to verify diagnostics are suppressed Rebased on current main; original PR #1755 by chaliy.
ebd0f69 to
0ea13c3
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
collect_rg_inputsnow accumulates read errors intocollected_inputs.stderr, but severalopts.quietearly-return paths usedExecResult::ok(...)which dropped those diagnostics causingrg -q needle missing.txt readable.txtto lose missing-file messages when--messagesis enabled.Description
return Ok(ExecResult::ok(String::new()))quiet-path returns withExecResultvalues that setstdoutto empty,stderrtocollected_inputs.stderr.clone(), andexit_codeto0in the binary/text/multiline/line-match quiet branches.rgdifferential suite that cover-qwith a missing file plus a matching readable file and the--no-messages -qcounterpart to assert diagnostics are present or suppressed appropriately.rgbehavior and exit-code semantics unchanged.Testing
cargo test -p bashkit rg::tests::test_rg_diff_cases -- --nocapturewhich executed thergdifferential cases and completed successfully with no test failures.Codex Task