0

I'm currently trying to maintain some basic version control (git) over my Unity projects, but I've faced a problem when trying to set up vsDiffMerge as my merge tool.

Currently, Unity's got its 'own', internal tool called UnityYAMLMerge, which may be set as a default one, cause of its integration with the engine. However, one may also specify a 'fallback' merge tool - called automatically by Unity, when UnityYAMLMerge fails to resolve the conflicts automatically.

What I'm trying to do is set up Visual Studio's vsDiffMerge as my fallback tool, but I've had little luck so far. No matter what I do its always the Difftool that opens - never the other one.

A brief recap on the current state of things:

1) I've configured UnityYAMLMerge as my default mergetool in .gitconfig (following the advice given in official docs) and I can say for sure that it works correctly.

2) Fallback merge tool reference needs to be specified inside Unity's mergespecfile, which I also did. It goes like this:

* use "%programs%\Microsoft Visual Studio\...\Team Explorer\vsDiffMerge.exe" "%l" "%r" "%b" "%d" /m

Where:

%l is replaced with the path of you local version

%r is replaced with the path of the incoming remote version

%b is replaced with the common base version

%d is replaced with a path where the result should be written to

On Windows %programs% is replaced with "C:\Program Files" and "C:\Program Files (x86)" there by resulting in two entries to try out

The above is an explanation from within the file.


I believe I've done quite a search about vsDiffMerge's command line arguments and tried multiple combinations but none of it worked. Perhaps only recently something changed about the way they behave?

NOTE: I've tried using the tool explicitly when facing a conflict, specifying its path in .gitconfig and then running

git mergetool --tool="vsdiffmerge"

and it worked (with arguments set in the same manner as above). It seems to be something 'mergespecfile'-specific, but I can't tell if that's really the case.

NOTE#2: Other tools (e.g. kdiff3) do work like that, so its definitely not a general issue.

Would appreciate any help on the subject. Thanks in advance.

mdx
  • 534
  • 3
  • 16
  • But why would you not want to use kdiff3? Visual studio supports it so well that you only have to point the mergetool configuration the kdiff3.exe file and then it will automatically fill inn the required `%` parameters in correct order. – hlovdal Jun 15 '18 at 17:28
  • Unless I got something wrong, you're talking about Team Foundation Server settings, because that's the only way users can add 3rd party tools to VS (at least the only I heard of, correct me if I'm wrong, please). However, choosing it as your version control plugin disables git support as far as I know, which I don't want to do. – mdx Jun 17 '18 at 18:11

0 Answers0