Page 1 of 1

Using CodeMerge with Git Bash

Posted: Mon 09 Jul 2012 19:17
by Ray
I'm trying to setup CodeMerge to be my default mergetool. I followed the configurations outlined here: http://stackoverflow.com/questions/9627 ... tool-setup

This worked perfectly for when I used it for diffing files. However when I tried to use the merge tool, it doesn't even open the program. It immediately fails and gives me:
$ git mergetool
Merging:
check.txt

Normal merge conflict for 'check.txt':
{local}: modified file
{remote}: modified file
Hit return to start merge resolution tool (codecompare):
merge of check.txt failed
I am currently using the latest demo, and contemplating on getting the pro version depending on whether or not I can get this to work. I should mention that I can get code merge to work using tortoiseGit, but I prefer to do most of my work via Git Bash.
Any help would be appreciated, thanks.

Re: Using CodeMerge with Git Bash

Posted: Wed 18 Jul 2012 14:32
by Artem
We will ask msysGit developers to support Code Compare. As a workaround you can create a file with .sh extension with the following content:

Code: Select all

cmd /c "C:\PROGRA~1\Devart\CODECO~1\CodeMerge.exe /MF=\"$1\" /TF=\"$2\" /BF=\"$3\" /RF=\"$4\""
In gitconfig specify the following command in the [mergetool "codecompare"] section:

Code: Select all

# Specify a path to your bash:
cmd = 'C:\\Program Files\\Devart\\Code Compare\\gitcodemerge.sh' $LOCAL $REMOTE $BASE $MERGED

Re: Using CodeMerge with Git Bash

Posted: Thu 26 Jul 2012 17:36
by Ray
Thank you for the reply, Artem.

Unfortunately I hit upon another error. I get

Code: Select all

'F' is not recognized as an internal or external command,
operable program or batch file.

Re: Using CodeMerge with Git Bash

Posted: Fri 27 Jul 2012 09:54
by Artem
Make sure you specify the paths in proper format: short 8.3 names with single backslashes in the bash file, full names with double backslashes in the gitconfig file.

Re: Using CodeMerge with Git Bash

Posted: Wed 22 Aug 2012 15:00
by yhersh
Hi,

I am evaluating the product and I would like to know if this issue has been resolved.

I am facing the same error while trying to configure it to work with git extensions

Thanks

Re: Using CodeMerge with Git Bash

Posted: Mon 27 Aug 2012 11:32
by Artem
The Code Compare support will be added in the next release of Git for Windows (you can write its developer team for more exact information). Now you can use a workaround described in this topic. Also, if you use Code Compare version 2.80.4 or later, you can try the following configuration:

Code: Select all

[difftool "codecompare"]
   cmd = 'C:\\Program Files\\Devart\\Code Compare\\codecompare.exe' "$LOCAL" "$REMOTE"
   renames = true
[diff]
   tool = codecompare
[mergetool "codecompare"]
   cmd = 'C:\\Program Files\\Devart\\Code Compare\\codemerge.exe' -MF="$LOCAL" -TF="$REMOTE" -BF="$BASE" -RF="$MERGED"
   trustExitCode = true
[mergetool]
   keepBackup = false
[merge]
   tool = codecompare
Note that command line arguments are preceded by a minus.