Feat/stageignore#51
Conversation
|
Ready to review this PR? Stage has broken it down into 5 individual chapters for you: Chapters generated by Stage for commit 08296dd on Jun 2, 2026 12:15am UTC. |
There was a problem hiding this comment.
Code Review
This pull request introduces support for a .stageignore file, allowing users to exclude specific files or directories from the diff analysis using glob patterns. The implementation includes a new utility to load patterns from the repository root and updates to the file filtering logic using the picomatch library. A review comment identifies a potential issue with the current filtering logic where splitting patterns into slash-containing and slash-less groups breaks negation support; it suggests using a single picomatch call with matchBase: true to preserve correct behavior.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c42cfac87c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
4af8749 to
c42cfac
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2fbb7abed
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
sweet! |
4b27773 to
29844d1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 29844d11ef
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57f1f0a2ac
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
57f1f0a to
1500e1b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1500e1b15c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
1500e1b to
b882f93
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b882f93af1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
dastratakos
left a comment
There was a problem hiding this comment.
see comment about ignore package, which I think is more standard.
Allow users to place a .stageignore file in the repo root with glob patterns to exclude files from diff analysis. Uses picomatch for matching. Excluded files still appear in the "Other changes" chapter.
Patterns without slashes (e.g. *.generated.ts) now match files in subdirectories, aligning with .gitignore behavior. Patterns with slashes keep the default picomatch behavior.
Patterns prefixed with ! re-include previously excluded files, following .gitignore semantics (last matching pattern wins). Each pattern is compiled individually so matchBase is applied per-pattern based on whether it contains a slash.
Per review feedback: the ignore package implements gitignore semantics natively (comments, blank lines, negation, anchoring), so the hand-rolled compile/match layer is no longer needed. - Replace picomatch + @types/picomatch with ignore@^7.0.5 - Rename loadStageIgnorePatterns -> loadStageIgnore (returns Ignore | null) - Drop CompiledPattern, compileIgnorePatterns, isIgnoredByPatterns - Update prep.ts and show.ts callers - Update tests to construct Ignore instances directly; add empty-file test - README: clarify ".gitignore-style patterns" instead of "glob patterns" Minor behavior change: leading whitespace on a pattern is no longer stripped (the previous code did line.trim()). This aligns with the gitignore spec, which strips only trailing whitespace.
b882f93 to
08296dd
Compare
Summary
Adds
.stageignoresupport — a repo-level config file that lets users exclude files from Stage's diff analysis using glob patterns, similar to.gitignore. This solves the problem of auto-generated or project-specific files (buildartifacts, generated configs, vendor directories) bloating the LLM context when the built-in denylist doesn't cover them.
Changes
loadStageIgnorePatterns()tofilter-files.tsto read and parse.stageignorefrom the repo rootfilterFilesForLlm()to accept optional ignore patterns, matched viapicomatchprep.tsandshow.tsso both commands respect the same ignore filepicomatchas a dependency for glob matching.stageignoreusage in the READMETesting
filter-files.test.ts)build/config.gypi(520 lines of auto-generated node-gyp config) was being included in the diff — confirmed it is excluded with a.stageignorecontainingbuild/**.stageignoreis absentSummary by cubic
Adds
.stageignoresupport to exclude files from diff analysis using.gitignore-style patterns. Bothstage prepandstage showload patterns from the repo root, and matching follows gitignore semantics.New Features
.stageignorewith gitignore semantics: comments, blank lines, negation, root anchoring, directory patterns; slashless globs match nested files; last match wins.loadStageIgnore()and integrated into both commands. README and tests updated (including empty-file case).Dependencies
ignore.picomatchand@types/picomatch.Written for commit 08296dd. Summary will update on new commits.