Repository navigation
fix(cli): reject unrecognized nonempty patch input - #1183
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
benvinegar
marked this pull request as ready for review
October 13, 2026 18:17
Contributor
|
1 task
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1181.
Reject nonempty explicit patch input when Pierre recognizes no file changes, instead of silently presenting a successful zero-file review. Print a useful diagnostic and return exit status 1.
Approach
Tests
main; the preexisting malformed-input test now asserts the intentional rejection behavior.Validation on Linux:
bun run typecheck,bun run lint,bun run format:check,bun run deps:check— passed on the final changes.bun test packages/hunk/src/core/changeset/loaders.patch.test.ts packages/hunk/src/core/theme/detection.test.ts test/cli/patch-input.test.ts test/pty/invalid-patch-integration.test.ts— 28 passed.bun run test— final rerun: 5,100 passed, 13 skipped, no failures.bun run test:integration— 256 passed, 1 skipped, no failures. This full run started before the new invalid-patch PTY test was added; that test passed separately afterward.bun test test/pty/terminal-theme-integration.test.ts test/pty/pager.test.ts test/pty/invalid-patch-integration.test.ts test/pty/watch-start-integration.test.ts— 18 passed, no failures, covering terminal probes, piped input, keyboard/mouse, startup watch and invalid-input exit.bun run test:tty-smoke— final rerun: 11 passed, no failures.CI follow-up
Added a separate test-only commit to address CI failures:
main(6aa52617, Website run). StableLatestand release ordering/link assertions remain intact. All 103 browser smoke tests passed locally (1 skipped).No product behavior, generated release metadata or workflow gating changes are included in this follow-up. The identical test-only commit is also on #1182 so both independent PRs can pass CI.
Real terminal evidence
Source
hunk patch bad.patch --no-extensions, wherebad.patchcontains onlynot a patch, in a real Linux tmux PTY at 120×32 with the default terminal theme:The excerpt is actual tmux screen text, not redirected CLI stdout. The new PTY test verifies the same failure/exit behavior. macOS and Windows not tested locally; non-PTY tests use portable process/path APIs. No installed binary or existing user window was changed.
Limits
This rejects entirely unrecognized nonempty input; it does not add exhaustive validation of every patch record or change partially recognized inputs. Plain-text
hunk pagerfallback remains unchanged.This PR description was generated by Pi using gpt-6.1-sol