Skip to content

feat(rg): add case-insensitive glob filters - #1666

Merged
chaliy merged 1 commit into
mainfrom
2026-05-22-rg-glob-case
May 22, 2026
Merged

chaliy merged 1 commit into
mainfrom
2026-05-22-rg-glob-case

Conversation

@chaliy

@chaliy chaliy commented May 22, 2026

Copy link
Copy Markdown
Contributor

What

Add rg glob parity for --iglob, --glob-case-insensitive, and --no-glob-case-insensitive; also make multiple glob rules use real ripgrep's last-match-wins precedence.

Why

Bashkit rg supported -g/--glob, but did not support case-insensitive glob modes and treated all exclude globs as absolute, which diverged from real rg when later globs overrode earlier ones.

How

  • Track glob rule order and resolve the final matching rule per path.
  • Add case-insensitive glob compilation for --iglob and global toggling for normal -g/--glob rules.
  • Match real rg --files exit status when filtering leaves no files.
  • Add data-driven real-rg differential cases for glob precedence, --iglob, case-insensitive toggles, and --files no-match behavior.

Risk

  • Medium
  • Changes path filtering behavior for rg. Covered by focused rg tests, expanded real-rg differential cases, and full pre-pr.

Checklist

  • Tests added or updated
  • Backward compatibility considered

@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 d53396c Commit Preview URL May 22 2026, 08:55 AM

@chaliy
chaliy merged commit 83e3c53 into main May 22, 2026
34 checks passed
@chaliy
chaliy deleted the 2026-05-22-rg-glob-case branch May 22, 2026 09:07
chaliy added a commit that referenced this pull request May 30, 2026
## What
Add rg glob parity for `--iglob`, `--glob-case-insensitive`, and
`--no-glob-case-insensitive`; also make multiple glob rules use real
ripgrep's last-match-wins precedence.

## Why
Bashkit rg supported `-g/--glob`, but did not support case-insensitive
glob modes and treated all exclude globs as absolute, which diverged
from real rg when later globs overrode earlier ones.

## How
- Track glob rule order and resolve the final matching rule per path.
- Add case-insensitive glob compilation for `--iglob` and global
toggling for normal `-g/--glob` rules.
- Match real `rg --files` exit status when filtering leaves no files.
- Add data-driven real-rg differential cases for glob precedence,
`--iglob`, case-insensitive toggles, and `--files` no-match behavior.

## Risk
- Medium
- Changes path filtering behavior for rg. Covered by focused rg tests,
expanded real-rg differential cases, and full pre-pr.

## 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