# easily use meld 3-pane view to review merge commits?

3 messages from 2025-05-03 to 2025-05-09. Participants: Britton Kerin, Johannes Sixt, D. Ben Knoble.
Thread: https://gitlist.dev/t/63391

## Britton Kerin, 2025-05-03 21:55

Subject: easily use meld 3-pane view to review merge commits?
Message-ID: <CAC4O8c9OJQQn_22i0-bZUDtHoi+ti6aT6FwupnQBoBFg6BNK6w@mail.gmail.com>
URL: https://gitlist.dev/e/CAC4O8c9OJQQn_22i0-bZUDtHoi%2Bti6aT6FwupnQBoBFg6BNK6w%40mail.gmail.com

```
I like how git-mergetool can use meld with 3 pane view to see merge conflicts:

  git mergetool --tool=meld

I'd like to use the same sort of view to see already-committed merges,
but I didn't find an easy way to do it.  It seems like git-diff,
git-difftool and git-show are oriented entirely towards diff or 2-pane
view rather than diff3/3-pane that git-mergetool uses.  Did I miss the
existing functionality somehow?

I asked about this on stackoverflow and made an answer with a script also:

  https://stackoverflow.com/questions/79599180/show-a-git-merge-commit-in-three-panel-form-inimeld

If there isn't any existing automatic way to inspect merge commits in
this way I'd like to improve this script and turn it into git-meld3 or
something.  It's tempting to think it could be wedged into the
existing diff-oriented architecture of git-diff/difftool/show but the
result would probably be too confusing to be useful.

Britton

```

## Johannes Sixt, 2025-05-04 09:00

Subject: Re: easily use meld 3-pane view to review merge commits?
Message-ID: <50428492-8ece-426f-bfea-071b7bd2c374@kdbg.org>
URL: https://gitlist.dev/e/50428492-8ece-426f-bfea-071b7bd2c374%40kdbg.org
In-Reply-To: <CAC4O8c9OJQQn_22i0-bZUDtHoi+ti6aT6FwupnQBoBFg6BNK6w@mail.gmail.com>

```
Am 03.05.25 um 23:55 schrieb Britton Kerin:
> I like how git-mergetool can use meld with 3 pane view to see merge conflicts:
> 
>   git mergetool --tool=meld
> 
> I'd like to use the same sort of view to see already-committed merges,
> but I didn't find an easy way to do it.  It seems like git-diff,
> git-difftool and git-show are oriented entirely towards diff or 2-pane
> view rather than diff3/3-pane that git-mergetool uses.  Did I miss the
> existing functionality somehow?

I see a conceptual inconsistency with the desire to use a 3-pane view
with a merge commit.

When merge conflicts are to be resolved, you have exactly 4 versions of
a file to work with: base, ours, theirs, and the merge result. (Meld
does not show the base and uses only 3 panes.) For this reason, it makes
sense to have 3 panes in a merge tool, perhaps a forth for the merge
base. That's it. You never need to have more than that.

With a merge commit, you can have: the merge result, the first parent,
and the second parent... and the third parent, the fourth parent, etc.
You can have any number of versions to deal with.

How does that fit into the picture? Can meld (or any other merge tool)
have any number of panes and still work in a reasonable way? Why should
2-parent merge commits be special-cased?

That was the devil's advocate speaking. 2-parent merge commits are
common enough that some merge tool support could make sense, but we
should be aware that there is a conceptual hurdle.

-- Hannes


```

## D. Ben Knoble, 2025-05-09 15:52

Subject: Re: easily use meld 3-pane view to review merge commits?
Message-ID: <CALnO6CDNPWWCWXvkpU0BUmaCzUfyZQhrtcxi1Nw_MBwVO6BKnQ@mail.gmail.com>
URL: https://gitlist.dev/e/CALnO6CDNPWWCWXvkpU0BUmaCzUfyZQhrtcxi1Nw_MBwVO6BKnQ%40mail.gmail.com
In-Reply-To: <50428492-8ece-426f-bfea-071b7bd2c374@kdbg.org>

```
On Sun, May 4, 2025 at 5:38 AM Johannes Sixt <j6t@kdbg.org> wrote:
> […]
> When merge conflicts are to be resolved, you have exactly 4 versions of
> a file to work with: base, ours, theirs, and the merge result. (Meld
> does not show the base and uses only 3 panes.) For this reason, it makes
> sense to have 3 panes in a merge tool, perhaps a forth for the merge
> base. That's it. You never need to have more than that.
>
> With a merge commit, you can have: the merge result, the first parent,
> and the second parent... and the third parent, the fourth parent, etc.
> You can have any number of versions to deal with.
>
> How does that fit into the picture? Can meld (or any other merge tool)
> have any number of panes and still work in a reasonable way? Why should
> 2-parent merge commits be special-cased?

Out of idle curiosity (with some Zsh shorthands):

for x (a b c d e); print -l 1 2 3 | shuf > $x'
vimdiff {a..e}

Turns out vimdiff can handle this and be reasonable, yep. Partly
because we can have arbitrarily many splits. It's still a bit
difficult to understand, though.

-- 
D. Ben Knoble

```
