Conversation
During paused merges and rebases, Git emits merge conflicts as `diff --cc` or `diff --combined` patches instead of ordinary `diff --git` blocks. Normalize those combined headers and hunks into a first-parent unified diff so Hunk can parse and render them. Add unit and static-renderer coverage for conflicts, binary entries, quoted paths, and multiple parents.
|
@0xferrous is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
`git show` puts merge-commit metadata before its combined diff. The metadata stripper recognized only ordinary patch headers, so it discarded the entire `diff --cc` or `diff --combined` body and Hunk showed no files. Recognize combined patch headers as the end of metadata and add regression coverage for merge-commit output.
Member
|
Nice. Is this ready? (currently marked as draft) |
0xferrous
force-pushed
the
fix/git-combined-conflict-diff
branch
from
September 19, 2026 07:09
8211497 to
542303e
Compare
0xferrous
marked this pull request as ready for review
September 19, 2026 07:09
Contributor
|
PR author is not in the allowed authors list. |
This branch has not been 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
When Git is paused during a conflicted merge or rebase,
git diffemits a combined diff usingdiff --cc/diff --combinedheaders and@@@hunk syntax. Withcore.pager = "hunk pager", Hunk previously treated this input as an empty review:The pager/difftool configuration was valid; Hunk’s patch sanitizer did not support Git’s combined conflict format.
Fix
Normalize combined Git patches into the existing unified patch format before parsing:
diff --git/@@syntax.--combined-all-pathsby retaining the first parent’s path.This keeps the behavior in the shared patch-sanitization layer used by Hunk’s existing consumers.
Reproduction
Configure Hunk as Git’s pager:
git config --global core.pager "hunk pager"Start a conflicting merge or rebase.
Run:
Before this change, Hunk displayed an empty review. After this change, it displays the conflicted file and its conflict markers.
Validation
bun run typecheckoxfmt --checkgit diff --checkpatchChangeset forhunkdiffVisual evidence was captured from the real Hunk TUI for the blank before state and rendered after state.
before:

after:
