1

This question shows how to set meld as the git mergetool, and notes

If you have more than 1 file with merge conflicts then git will open a new Meld window for each, one after another until they are all done.

Setting up and using Meld as your git difftool and mergetool

When I use meld with mercurial merge, I get the entire set of conflicts, one tab per file, similar to this meld command:

meld --auto-compare -output=merged-changes their-changes merged-changes my-changes

How can I configure git to achieve the same results (one meld invocation, with each conflicting file in its own tab)?

Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
  • Git's `git mergetool` runs one command per file, then checks the exit status from the one command (if told to trust its exit status) and uses that to decide whether that one file is merged OK, and then moves on to the next file. That's sufficiently philosophically opposed to what you want to do—run one `meld` command with *all* files—that I think you'll have to rewrite `git mergetool`. It's a simple (well... complicated) shell script so you should be able to come up with something. – torek May 26 '22 at 07:31
  • Fortunately Git makes it *really easy* to invoke your own program. Just write it up and make it work and then put it somewhere in your `$PATH`. If it's named `git-foo`, running `git foo` will invoke your program with `$GIT_DIR` and `$GIT_WORKTREE` set appropriately and so on. – torek May 26 '22 at 07:33

0 Answers0