Git launches mergetool without any arguments

On machine A, git mergetool runs Beyond Compare 3, as expected. On machine B, BC3 starts, but no arguments are passed on the command line, thus displaying the initial screen instead of the actual merge.

I copied the configuration from machine A to machine B, and git config --list identical except for the installation path and push.default=simple :

 merge.tool=bc3 mergetool.bc3='C:/Apps/BeyondCompare3/BCompare.exe' mergetool.bc3.cmd='C:/Apps/BeyondCompare3/BCompare.exe' mergetool.bc3.path=C:\Apps\BeyondCompare3\bcomp.exe push.default=simple 

The only difference is that machine A has git 1.7.11 under Win7 64-bit, while machine B (the one that does not work) has git 1.8.4 under Win8 32-bit.

ProcessHacker shows that the command line on machine A (for the same repository, bit for bit):

 "c:\Program Files (x86)\Beyond Compare 3\bcomp.exe" ./somefile.cs.LOCAL.4192.cs ./somefile.cs.REMOTE.4192.cs ./somefile.cs.BASE.4192.cs -mergeoutput=somefile.cs /BCompWnd=$00140644 

and on a broken machine B, it's simple:

 c:\Apps\BeyondCompare3\BCompare.exe 

What magic spell do I need here?

+6
source share
1 answer

Just suppose: if Git already (in the factory configuration) knows about the bc3 tool, it will use mergetool.bc3.path along with the standard arguments. If not, it looks for mergetool.bc3.cmd , but for this you need to have the correct arguments specified in the command:

 mergetool.bc3.cmd="'c:/apps/BeyondCompare3/bcomp.exe' '$LOCAL' '$REMOTE' '$BASE' '$MERGED'" 

For an unclear reason, on machine B, Git does not know the call to bc3 and returns using mergetool.bc3.cmd , which in your case skips the correct arguments. On machine A, Git knows how to talk to BC3, and will use the correct tool call using only mergetool.bc3.path .

To verify this deletion, respectively, of mergetool.bc3.cmd and mergetool.bc3.path on machines A and B, the behavior should be exactly the same as you observe.

To fix this, use the full call to mergetool.bc3.cmd .

+4
source

All Articles