Skip to content

fix(rg): honor --no-context-separator between files#1749

Merged
chaliy merged 1 commit into
mainfrom
2026-05-25-fix-no-context-separator-handling
May 25, 2026
Merged

fix(rg): honor --no-context-separator between files#1749
chaliy merged 1 commit into
mainfrom
2026-05-25-fix-no-context-separator-handling

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented May 25, 2026

Motivation

  • rg honored --no-context-separator only for intra-file gaps but still emitted the context separator unconditionally before starting matches for a later file, causing output to differ from real ripgrep.

Description

  • Gate inter-file context-separator emissions on !opts.no_context_separator in all three output paths (multiline inverted, multiline normal, and regular) in crates/bashkit/src/builtins/rg/mod.rs.
  • Add a differential test case no context separator between files exercising -n -C1 --no-context-separator across two files to cover the regression.
  • Update is small and localized to crates/bashkit/src/builtins/rg/mod.rs and the rg differential test table.

Testing

  • Ran cargo test -p bashkit builtins::rg::tests -- --nocapture, which compiled and executed the rg tests; 46 tests passed and 1 test failed (diff_rg_matches_real_rg_cases) due to an existing timing-line mismatch with real rg that is unrelated to this fix.
  • Attempted to sync with remote via git fetch origin main but it failed because this checkout has no origin remote configured.

Codex Task

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 25, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 99844e2 Commit Preview URL May 25 2026, 02:36 AM

@chaliy chaliy merged commit 022f31b into main May 25, 2026
34 checks passed
@chaliy chaliy deleted the 2026-05-25-fix-no-context-separator-handling branch May 25, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant