Skip to content

grep: support recursive include and exclude globs - #839

Merged
ewhauser merged 9 commits into
mainfrom
codex/grep-include-exclude
Jul 12, 2026
Merged

ewhauser merged 9 commits into
mainfrom
codex/grep-include-exclude

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • add repeatable --include=GLOB and --exclude=GLOB options to grep
  • filter recursively discovered files by basename while preserving explicit file operands
  • make exclusions override inclusions and add regression/fuzz coverage

Closes #835

Testing

  • go test ./internal/builtins -run 'TestGrep(RecursiveIncludeAndExcludeGlobs|RecursiveSearchAvoidsSymlinkLoops|UsageErrorsReturnExitCodeTwo)$' -count=1\n- go test ./internal/runtime -run '^$' -fuzz '^FuzzGrepFlagsCommand$' -fuzztime=1s\n- make lint\n- make test (grep and oracle packages passed; two unrelated host-tail timing tests failed transiently and passed in isolation)

@ewhauser
ewhauser force-pushed the codex/grep-include-exclude branch from 7aabe4c to 302c729 Compare July 12, 2026 11:47

@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: 7aabe4caf8

ℹ️ 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/grep.go Resolved
Comment thread internal/builtins/xargs.go Resolved
Comment thread internal/builtins/grep.go Resolved
@ewhauser

Copy link
Copy Markdown
Owner Author

@codex review

@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: 17c631f1df

ℹ️ 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/grep.go Resolved
Comment thread internal/builtins/grep.go Resolved
Comment thread internal/builtins/grep.go Resolved
@ewhauser

Copy link
Copy Markdown
Owner Author

@codex review

@ewhauser

Copy link
Copy Markdown
Owner Author

@codex review

@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: c6e22061f2

ℹ️ 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/grep.go Resolved
@ewhauser

Copy link
Copy Markdown
Owner Author

@codex review

@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: e074f32af2

ℹ️ 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/grep.go Resolved
@ewhauser

Copy link
Copy Markdown
Owner Author

@codex review

@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: 5af04fad27

ℹ️ 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/grep.go Resolved
Comment thread internal/builtins/grep.go Resolved
@ewhauser

Copy link
Copy Markdown
Owner Author

@codex review

@ewhauser
ewhauser enabled auto-merge (squash) July 12, 2026 21:20
@ewhauser
ewhauser merged commit a5d3848 into main Jul 12, 2026
16 checks passed
@ewhauser
ewhauser deleted the codex/grep-include-exclude branch July 12, 2026 21:27
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.

grep --include=GLOB — missing feature

1 participant