1

I am using meld with git for merging and I want to try vimdiff. Configured three way merge with git and then my own diff command:

[merge]
    tool = vimdiff3
    conflictstyle = diff3
[mergetool "vimdiff3"]
    cmd = gvim -f -d \"$LOCAL\" \"$BASE\" \"$REMOTE\" \"$MERGED\"

But everytime I try to run mergetool, git just quickly respond "[file] seems unchanged" and skips the merge.

On top of that, I'd like to get real three-way merge (four files) with merged window in the bottom, this shold work but I saw many reports it is not working on the internet:

    cmd = gvim -f -d -c \"wincmd J\" \"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
2
  • Try splice for three-way merge. Commented Jun 15, 2012 at 12:28
  • 1
    Or threesome which is nothing short of awesome Commented Jun 18, 2012 at 10:27

1 Answer 1

1

You could check if the upcomming mergetools/vimdiff3 setting (for git 2.0.x Q3 2014) would work for you.

See commit 7c147b7 by Felipe Contreras (felipec), merged only recently in commit 3a9dae7 (June 2014):

mergetools: add vimdiff3 mode

It's similar to the default, except that the other windows are hidden.
This ensures that removed/added colors are still visible on the main merge window, but the other windows not visible.

Specially useful with merge.conflictstyle=diff3.

gvimdiff3|vimdiff3)
  if $base_present
  then
    "$merge_tool_path" -f -d -c 'hid | hid | hid' \
      "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
  else
    "$merge_tool_path" -f -d -c 'hid | hid' \
      "$LOCAL" "$REMOTE" "$MERGED"
  fi
;;

The new file mergetools/vimdiff3 has been added, which means that all you would need to do is:

git mergetool --tool=vimdiff3

(without having to configure mergetool.vimdiff3.cmd)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.