dandavison / delta

A syntax-highlighting pager for git, diff, grep, and blame output
https://dandavison.github.io/delta/
MIT License
22.76k stars 381 forks source link

🐛 Ambiguous display of resolved merge conflicts in side-by-side view #1524

Open Terrance opened 1 year ago

Terrance commented 1 year ago
Example git graph and diffs ``` * Merge branch 'branch' (HEAD -> main) |\ diff --cc file | | index 5716ca5,7601807..d90bda0 | | --- a/file | | +++ b/file | | @@@ -1,1 -1,1 +1,1 @@@ | | - bar | | -baz | | ++quux | | | * Update to baz | | diff --git a/file b/file | | index 257cc56..7601807 100644 | | --- a/file | | +++ b/file | | @@ -1 +1 @@ | | -foo | | +baz | | * | Update to bar |/ diff --git a/file b/file | index 257cc56..5716ca5 100644 | --- a/file | +++ b/file | @@ -1 +1 @@ | -foo | +bar | * Add file | diff --git a/file b/file | new file mode 100644 | index 0000000..257cc56 | --- /dev/null | +++ b/file | @@ -0,0 +1 @@ | +foo ```

During the conflict resolution for the merge commit, delta shows the handy split ancestor view with both changes to file:

image

Once committed, showing the commit in one-column mode retains git's own two-column +/- indicators, which works ok:

image

But in two-column mode, there's no indication of which ancestor each line came from, and the line numbers are misleading:

image