Skip to content

feat(rg): add gzip search mode - #1676

Merged
chaliy merged 1 commit into
mainfrom
2026-05-22-rg-batch-2
May 22, 2026
Merged

chaliy merged 1 commit into
mainfrom
2026-05-22-rg-batch-2

Conversation

@chaliy

@chaliy chaliy commented May 22, 2026

Copy link
Copy Markdown
Contributor

What

Adds rg -z/--search-zip support for gzip-compressed files, including --no-search-zip toggling and help coverage.

Why

Real rg searches compressed files when requested; bashkit rg previously treated gzip payloads as opaque binary data.

How

  • Parse -z, --search-zip, and --no-search-zip.
  • Decompress gzip payloads before rg text decoding/search.
  • Disable indexed search for compressed mode so VFS traversal can decode bytes.
  • Add real-rg differential cases for explicit, recursive, and disabled gzip search.

Risk

  • Low. Scoped to rg compressed-input mode.
  • Gzip decode failures are treated as unreadable file content in recursive search.

Checklist

  • Tests added or updated
  • Backward compatibility considered

Verification:

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

@chaliy
chaliy marked this pull request as ready for review May 22, 2026 13:23
@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 8fa86d8 Commit Preview URL May 22 2026, 01:23 PM

@chaliy
chaliy merged commit ee3b1f0 into main May 22, 2026
34 checks passed
@chaliy
chaliy deleted the 2026-05-22-rg-batch-2 branch May 22, 2026 13:35
chaliy added a commit that referenced this pull request May 30, 2026
## What
Adds rg `-z`/`--search-zip` support for gzip-compressed files, including
`--no-search-zip` toggling and help coverage.

## Why
Real rg searches compressed files when requested; bashkit rg previously
treated gzip payloads as opaque binary data.

## How
- Parse `-z`, `--search-zip`, and `--no-search-zip`.
- Decompress gzip payloads before rg text decoding/search.
- Disable indexed search for compressed mode so VFS traversal can decode
bytes.
- Add real-rg differential cases for explicit, recursive, and disabled
gzip search.

## Risk
- Low. Scoped to rg compressed-input mode.
- Gzip decode failures are treated as unreadable file content in
recursive search.

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

Verification:
- `cargo test -p bashkit --lib 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