Skip to content

Show unified diff for compare inputs that carry an ancestor#2789

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:unified-diff-allow-ancestor
Jul 1, 2026
Merged

Show unified diff for compare inputs that carry an ancestor#2789
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:unified-diff-allow-ancestor

Conversation

@vogella

@vogella vogella commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The experimental unified diff overlay was only offered for strict 2-way compare inputs, because canShowInUnifiedDiff bailed out whenever the input carried a common ancestor.
That excluded EGit history compares such as "Compare With Previous Version", which attach a git merge-base ancestor even for a conceptually 2-way diff.
Since the overlay is computed purely from the left and right sides, the ancestor can safely be ignored.
With this change those compares render inline diff markers when the experimental unified diff preference is enabled.

canShowInUnifiedDiff rejected any ICompareInput with a common ancestor,
which excluded EGit history compares (e.g. Compare With Previous Version)
that attach a git merge-base ancestor. The overlay only renders left vs
right, so the ancestor can be ignored.
@vogella vogella requested a review from tobiasmelcher July 1, 2026 17:08
@vogella

vogella commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

It works from "Compare with -> Previous Revision".

image

Without this patch:

image

@vogella

vogella commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Also works now from the History view for files -> Compare with Previous version

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   54m 34s ⏱️ - 2m 36s
 4 680 tests ±0   4 658 ✅ ±0   22 💤 ±0  0 ❌ ±0 
11 934 runs  ±0  11 781 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit 75fe8ea. ± Comparison against base commit 64687f4.

@tobiasmelcher tobiasmelcher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot Lars.

@vogella vogella merged commit cb939ba into eclipse-platform:master Jul 1, 2026
18 checks passed
@vogella vogella deleted the unified-diff-allow-ancestor branch July 1, 2026 19:30
@vogella

vogella commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

thanks a lot Lars.

Awesome feature thanks a bunch @tobiasmelcher for providing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants