Skip to content

builtins: add rg command - #775

Merged
ewhauser merged 4 commits into
mainfrom
ewhauser/add-rg-builtin
Mar 29, 2026
Merged

ewhauser merged 4 commits into
mainfrom
ewhauser/add-rg-builtin

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • add a builtin rg command with ripgrep-style defaults, shared grep matching helpers, and recursive ignore/glob traversal
  • add direct behavior tests, oracle parity tests against pinned ripgrep, and fuzz metadata coverage for the new command
  • wire the pinned ripgrep oracle into Nix and make test, and update contributor/docs/spec references for the new command

Why

gbash previously shipped grep, egrep, and fgrep, but it did not provide a recursive ripgrep-style builtin or parity coverage against a pinned ripgrep oracle. This change adds a focused rg v1 surface and validates the supported behavior against the same pinned ripgrep version used in tests.

Impact

Users can now use rg directly inside gbash with recursive search defaults, ignore-file support, glob filters, explicit unsupported-flag diagnostics, and test-backed parity for the supported flag set.

Validation

  • go test ./internal/testutil -run '^TestResolveNixRipgrep$' -count=1
  • GBASH_CONFORMANCE_RIPGREP=$(./scripts/ensure-ripgrep.sh) GBASH_CONFORMANCE_DIFF=$(./scripts/ensure-diffutils.sh) go test ./internal/builtins -count=1
  • go test ./internal/runtime -run 'TestFuzzMetadataSeedCoverage|FuzzGeneratedPrograms' -count=1
  • make test
  • make lint

@ewhauser
ewhauser marked this pull request as ready for review March 28, 2026 23:02
@ewhauser ewhauser changed the title [codex] builtins: add rg command uiltins: add rg command Mar 28, 2026
@ewhauser ewhauser changed the title uiltins: add rg command builtins: add rg command Mar 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f42dc76091

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/builtins/rg.go Resolved
Comment thread internal/builtins/rg.go Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b48aa2eb93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/builtins/rg.go Resolved
Comment thread internal/builtins/rg.go Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5789202340

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/builtins/rg.go Resolved
Comment thread internal/builtins/rg.go Resolved
@ewhauser
ewhauser merged commit 6135989 into main Mar 29, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/add-rg-builtin branch March 29, 2026 00:39
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