Skip to content

feat(rg): add null-data record search - #1673

Merged
chaliy merged 1 commit into
mainfrom
2026-05-22-rg-null-data-stop
May 22, 2026
Merged

chaliy merged 1 commit into
mainfrom
2026-05-22-rg-null-data-stop

Conversation

@chaliy

@chaliy chaliy commented May 22, 2026

Copy link
Copy Markdown
Contributor

What

Add real rg --null-data support for NUL-delimited input records and output record terminators, plus --stop-on-nonmatch behavior.

Why

Continue closing parity gaps between bashkit rg and real ripgrep.

How

  • Split searched content on NUL records when --null-data is set.
  • Use NUL output record terminators for match, count, context, heading, and file-list output paths where real rg does.
  • Stop a file search after a non-matching record follows a prior match for --stop-on-nonmatch.
  • Add data-driven differential cases against pinned real rg.

Risk

  • Low / Medium
  • Output framing changes are scoped to rg --null-data; context and heading formatting are the main compatibility surface.

Checklist

  • Tests added or updated
  • Backward compatibility considered

Validation:

  • cargo fmt && cargo test -p bashkit builtins::rg::tests -- --nocapture
  • just pre-pr

@cloudflare-workers-and-pages

Copy link
Copy Markdown

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 8f02040 Commit Preview URL May 22 2026, 11:32 AM

@chaliy
chaliy merged commit 599d633 into main May 22, 2026
38 of 40 checks passed
@chaliy
chaliy deleted the 2026-05-22-rg-null-data-stop branch May 22, 2026 11:54
chaliy added a commit that referenced this pull request May 30, 2026
## What
Add real `rg --null-data` support for NUL-delimited input records and
output record terminators, plus `--stop-on-nonmatch` behavior.

## Why
Continue closing parity gaps between bashkit `rg` and real ripgrep.

## How
- Split searched content on NUL records when `--null-data` is set.
- Use NUL output record terminators for match, count, context, heading,
and file-list output paths where real rg does.
- Stop a file search after a non-matching record follows a prior match
for `--stop-on-nonmatch`.
- Add data-driven differential cases against pinned real `rg`.

## Risk
- Low / Medium
- Output framing changes are scoped to `rg --null-data`; context and
heading formatting are the main compatibility surface.

## Checklist
- [x] Tests added or updated
- [x] Backward compatibility considered

Validation:
- `cargo fmt && cargo test -p bashkit builtins::rg::tests --
--nocapture`
- `just pre-pr`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant