Skip to content

feat(rg): support globstar directory prefixes - #1707

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

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

Conversation

@chaliy

@chaliy chaliy commented May 23, 2026

Copy link
Copy Markdown
Contributor

What

Make rg globstar directory prefixes match real ripgrep behavior, so **/foo matches both top-level foo and nested paths.

Why

Real ripgrep's globset treats **/ as zero or more directories. Bashkit rg previously required at least one slash, so cwd-relative top-level files were incorrectly filtered out.

How

Translate **/ to an optional directory-prefix regex and add a real-rg differential case for --files -g '**/foo.txt' ..

Risk

  • Low
  • Affects rg glob matching for patterns containing **/; this should improve parity with real rg.

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 b1d2960 Commit Preview URL May 23 2026, 04:13 AM

@chaliy
chaliy merged commit d385f9d into main May 23, 2026
34 checks passed
@chaliy
chaliy deleted the 2026-05-22-rg-batch-28 branch May 23, 2026 04:25
chaliy added a commit that referenced this pull request May 30, 2026
## What
Make rg globstar directory prefixes match real ripgrep behavior, so
`**/foo` matches both top-level `foo` and nested paths.

## Why
Real ripgrep's globset treats `**/` as zero or more directories. Bashkit
rg previously required at least one slash, so cwd-relative top-level
files were incorrectly filtered out.

## How
Translate `**/` to an optional directory-prefix regex and add a real-rg
differential case for `--files -g '**/foo.txt' .`.

## Risk
- Low
- Affects rg glob matching for patterns containing `**/`; this should
improve parity with real rg.

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