Skip to content

feat(rg): support context and glob search - #1641

Merged
chaliy merged 1 commit into
mainfrom
2026-05-21-rg-flags
May 21, 2026
Merged

chaliy merged 1 commit into
mainfrom
2026-05-21-rg-flags

Conversation

@chaliy

@chaliy chaliy commented May 21, 2026

Copy link
Copy Markdown
Contributor

What

Adds rg support for context output, glob filtering, quiet/only-matching/regexp filename flags, and SearchCapable indexed recursive narrowing. Updates compatibility/status docs for the expanded rg surface.

Why

rg was limited to simple recursive matching and lacked common ripgrep workflows like -A/-B/-C and -g/--glob filters.

How

Extended rg option parsing and output rendering, added positive/negative glob rules, reworked recursive input collection to honor globs, and added indexed search with root containment checks. Added rg regression tests for context, globs, quiet/only-matching, and indexed search isolation.

Risk

  • Medium
  • rg output formatting and argument parsing changed; existing grep behavior is untouched.

Checklist

  • Tests added or updated
  • Backward compatibility considered

Verification:

  • cargo fmt --check
  • cargo test -p bashkit builtins::rg::tests:: -- --nocapture
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo run -p bashkit-cli -- -c 'mkdir -p proj/src proj/vendor; printf "before\nneedle\nafter\n" > proj/src/main.rs; printf "needle\n" > proj/src/main.txt; printf "needle\n" > proj/vendor/lib.rs; rg -n -C1 -g "*.rs" -g "!vendor/**" needle proj'\n- just pre-pr\n

@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 e444cf6 Commit Preview URL May 21 2026, 11:17 PM

@chaliy
chaliy merged commit 79781c4 into main May 21, 2026
34 checks passed
@chaliy
chaliy deleted the 2026-05-21-rg-flags branch May 21, 2026 23:30
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