Align merge commit diff behavior with first-parent semantics in but-core and update regression coverage#12796
Draft
Align merge commit diff behavior with first-parent semantics in but-core and update regression coverage#12796
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Copilot
AI
changed the title
[WIP] [GT-12795] Add test for issue resolution
Use merge-base for merge commit diffs in but-core and add regression coverage
Mar 12, 2026
bf2ad3b to
36d882e
Compare
36d882e to
806c67d
Compare
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
806c67d to
ed2cf5a
Compare
Byron
requested changes
Mar 12, 2026
Collaborator
Byron
left a comment
There was a problem hiding this comment.
Blocking the merge of the PR as there is open questions.
At least it's clear now that there is much to be learned and possibly implemented to deal with merges better.
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
Contributor
Author
Updated in 28c909d: I reverted merge-commit diff-base behavior to first-parent semantics (matching |
Copilot
AI
changed the title
Use merge-base for merge commit diffs in but-core and add regression coverage
Align merge commit diff behavior with first-parent semantics in but-core and update regression coverage
Mar 12, 2026
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.
This PR aligns merge-commit diff behavior with current expected semantics: for commit views, diffs should follow
git show/GitHub-style first-parent behavior rather than merge-base diffing.A previous iteration switched merge commits to merge-base diffing, but follow-up review showed this does not match expected behavior for this codepath.
What changed
but-core::diffso that:None(empty tree),CommitDetails::from_commit_id()ui::commit_changes_with_line_stats_by_worktree_dir()crates/but-core/tests/core/diff/ui.rsto assert first-parent output and stats.Result
Commit diff rendering for merge commits now matches first-parent semantics expected for this view, and tests guard against regressions in that behavior.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.