Using CodeMerge with Git Bash

Discussion of open issues, suggestions and bugs regarding file and folder merge tool – Code Compare
Post Reply
Ray
Posts: 2
Joined: Mon 09 Jul 2012 18:59

Using CodeMerge with Git Bash

Post by Ray » Mon 09 Jul 2012 19:17

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.

Artem
Devart Team
Posts: 137
Joined: Mon 21 Jun 2010 14:02

Re: Using CodeMerge with Git Bash

Post by Artem » Wed 18 Jul 2012 14:32

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

Ray
Posts: 2
Joined: Mon 09 Jul 2012 18:59

Re: Using CodeMerge with Git Bash

Post by Ray » Thu 26 Jul 2012 17:36

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.

Artem
Devart Team
Posts: 137
Joined: Mon 21 Jun 2010 14:02

Re: Using CodeMerge with Git Bash

Post by Artem » Fri 27 Jul 2012 09:54

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.

yhersh
Posts: 22
Joined: Fri 30 Apr 2010 12:13

Re: Using CodeMerge with Git Bash

Post by yhersh » Wed 22 Aug 2012 15:00

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

Artem
Devart Team
Posts: 137
Joined: Mon 21 Jun 2010 14:02

Re: Using CodeMerge with Git Bash

Post by Artem » Mon 27 Aug 2012 11:32

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.

Post Reply