Conversation
Add repeatable --only/-F flag to show only matching files in the diff view. Matches by exact path or path suffix. Shows message when no files match the filter. Bump plugin version to 0.2.2.
There was a problem hiding this comment.
Pull request overview
Adds a repeatable --only/-F CLI flag to filter the file list shown in the revdiff TUI, supporting exact-path and path-suffix matching and handling the “no matches” case.
Changes:
- Add
--only/-Foption wiring from CLI (cmd/revdiff) into the UI model config. - Implement file filtering in
ui.Modeland integrate it with single-file mode behavior. - Update README + Claude plugin skill/docs and bump plugin version to
0.2.2.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
ui/model.go |
Stores Only filter patterns, filters loaded file lists, and renders a no-match message. |
ui/model_test.go |
Adds unit tests for the filterOnly helper. |
cmd/revdiff/main.go |
Adds --only/-F flag and passes it into ui.ModelConfig. |
README.md |
Documents the new flag and provides usage examples. |
.claude-plugin/skills/revdiff/SKILL.md |
Updates skill docs to mention --only. |
.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh |
Updates usage comment to include --only. |
.claude-plugin/skills/revdiff/references/usage.md |
Adds usage examples for --only. |
.claude-plugin/skills/revdiff/references/config.md |
Adds --only to the config/flags reference table. |
.claude-plugin/plugin.json |
Bumps plugin version to 0.2.2. |
.claude-plugin/marketplace.json |
Bumps marketplace version to 0.2.2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| NoStatusBar bool // hide the status bar | ||
| NoConfirmDiscard bool // skip confirmation prompt when discarding annotations | ||
| Wrap bool // enable line wrapping | ||
| Wrap bool // enable line wrapping |
There was a problem hiding this comment.
ModelConfig.Wrap has extra spacing before the comment (bool // ...), which is inconsistent with gofmt output in the rest of the file. Running gofmt (or adjusting the spacing) will keep the struct formatting consistent.
| Wrap bool // enable line wrapping | |
| Wrap bool // enable line wrapping |
ui/model.go
Outdated
| NoConfirmDiscard bool // skip confirmation prompt when discarding annotations | ||
| Wrap bool // enable line wrapping | ||
| Wrap bool // enable line wrapping | ||
| Only []string // show only these files (filter by path suffix) |
There was a problem hiding this comment.
The Only field comment says it filters "by path suffix", but filterOnly also supports exact path matches (f == pattern). Consider updating the comment to reflect both exact-path and suffix matching to avoid misleading callers.
| Only []string // show only these files (filter by path suffix) | |
| Only []string // show only these files (match by exact path or path suffix) |
| files := m.filterOnly(msg.files) | ||
| if len(files) == 0 && len(m.only) > 0 { | ||
| m.viewport.SetContent("no files match --only filter") | ||
| return m, nil |
There was a problem hiding this comment.
The new --only no-match behavior ("no files match --only filter") isn’t covered by tests. Adding a test that sets m.only, sends a filesLoadedMsg with non-matching files, and asserts viewport content + no auto-select cmd would prevent regressions.
README.md
Outdated
| | `--wrap` | Enable line wrapping in diff view, env: `REVDIFF_WRAP` | `false` | | ||
| | `--no-confirm-discard` | Skip confirmation when discarding annotations with Q, env: `REVDIFF_NO_CONFIRM_DISCARD` | `false` | | ||
| | `--chroma-style` | Chroma color theme for syntax highlighting, env: `REVDIFF_CHROMA_STYLE` | `catppuccin-macchiato` | | ||
| | `-F`, `--only` | Show only these files, may be repeated (e.g. `--only=model.go --only=README.md`) | | |
There was a problem hiding this comment.
The README documents --only as "Show only these files", but the implementation matches both exact paths and path suffixes (e.g. --only=model.go matches ui/model.go). Consider mentioning the suffix/exact matching behavior here for clarity and to align with the actual semantics.
| | `-F`, `--only` | Show only these files, may be repeated (e.g. `--only=model.go --only=README.md`) | | | |
| | `-F`, `--only` | Show only matching files (exact paths or path suffixes), may be repeated (e.g. `--only=model.go --only=README.md`) | | |
Summary
--only/-Fflag to filter which files revdiff shows--only=model.gomatchesui/model.go)--onlysupport, version bumped to 0.2.2