Skip to content

feat(rg): add max-filesize filtering - #1667

Merged
chaliy merged 1 commit into
mainfrom
2026-05-22-rg-max-filesize
May 22, 2026
Merged

chaliy merged 1 commit into
mainfrom
2026-05-22-rg-max-filesize

Conversation

@chaliy

@chaliy chaliy commented May 22, 2026

Copy link
Copy Markdown
Contributor

What

Add rg --max-filesize support for recursive discovery and --files listing, including K, M, and G suffix parsing.

Why

Real ripgrep uses --max-filesize as a discovery filter for recursively found files. Bashkit rg should accept and match this common flag.

How

  • Parse --max-filesize NUM with real-rg-style byte/K/M/G units.
  • Filter recursive file candidates by VFS metadata size.
  • Bypass indexed search when this filter is active so size filtering is authoritative.
  • Add real-rg differential cases for recursive search, suffixes, explicit-file parity, --files, and empty filtered listings.

Risk

  • Low
  • Could affect rg recursive file discovery when size metadata is inaccurate.

Checklist

  • Tests added or updated
  • Backward compatibility considered

@chaliy
chaliy marked this pull request as ready for review May 22, 2026 09:16
@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 c4ab6db Commit Preview URL May 22 2026, 09:17 AM

@chaliy
chaliy merged commit 7a4b567 into main May 22, 2026
34 checks passed
@chaliy
chaliy deleted the 2026-05-22-rg-max-filesize branch May 22, 2026 09:28
chaliy added a commit that referenced this pull request May 30, 2026
## What
Add rg `--max-filesize` support for recursive discovery and `--files`
listing, including `K`, `M`, and `G` suffix parsing.

## Why
Real ripgrep uses `--max-filesize` as a discovery filter for recursively
found files. Bashkit rg should accept and match this common flag.

## How
- Parse `--max-filesize NUM` with real-rg-style byte/K/M/G units.
- Filter recursive file candidates by VFS metadata size.
- Bypass indexed search when this filter is active so size filtering is
authoritative.
- Add real-rg differential cases for recursive search, suffixes,
explicit-file parity, `--files`, and empty filtered listings.

## Risk
- Low
- Could affect rg recursive file discovery when size metadata is
inaccurate.

## Checklist
- [x] Tests added or updated
- [x] Backward compatibility considered
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