fix: keep one unparseable file from zeroing the whole review - #975
Open
vkurilyak wants to merge 1 commit into
Open
fix: keep one unparseable file from zeroing the whole review#975vkurilyak wants to merge 1 commit into
vkurilyak wants to merge 1 commit into
Conversation
Contributor
|
PR author is not in the allowed authors list. |
|
@vkurilyak is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
- Limit DCS/OSC stripping to same line so binary-looking bytes cannot eat newlines - Fall back to per-file parsing with visible placeholder when whole-patch parse throws - Add regression coverage for newline guarantee and keep-good-files fallback
vkurilyak
force-pushed
the
fix/one-bad-file-zeroes-review
branch
from
September 3, 2026 10:58
7ce0308 to
bf390c8
Compare
Member
|
@vkurilyak Thanks for fixing this! |
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.
I tried Hunk after reading https://x.com/mitchellh/status/2052128048288567617 by Mitchell Hashimoto (https://github.com/mitchellh).
I need better tooling for code reviews before merging changes into production (main branches on GitHub), so a terminal review tool for changesets is exactly what I was looking for.
Hunk showed
0 files +0 -0andNo files match the current filter.on a working copy with 2275 changed files, while a scopedhunk diff -- <single-file>worked fine.Root cause was 2 PDF files in the same review, both emitted by the VCS as text rather than
Binary files ... differ:Both contain
ESC ] ... BEL-looking binary bytes spanning newlines.stripTerminalControlate across the newlines, corrupting@@hunk line counts, so@pierre/diffsthrewhunk line count mismatch/hunk has more lines than expectedandchangesetFromPatchreturned zero files for the whole review.This change limits DCS/OSC stripping to the same line so binary-looking bytes cannot eat newlines, and adds a per-file-chunk fallback so one unparseable file becomes a visible placeholder instead of discarding all files. It also adds regression coverage for both the newline guarantee and the keep-good-files fallback.
Tests:
bun test src/core/patch src/core/changesetchangesetFromPatchon the original 6.1 MB patch: 2275 files (was 0)