3

I want to use SemanticMerge as my mergetool in Git, but when I try to perform a merge, I get a complaint from SemanticMerge saying that it cannot locate the file C:\Program Files (x86)\Git\my_repo_name\my_project\MyFile.cs.BASE.1234.cs - which is absolutely correct as it should be at C:\repositories\my_repo_name\my_project\MyFile.cs and so on. For some reason although Git is working with the repositories in every other respect, it seems to be determined to pass the $BASE, $LOCAL and $REMOTE file paths with the Git install path prepended instead of the repository root.

I have been using the configuration suggested in their own tutorial as a starting point for this and the tool seems to work fine if given the correct paths, so I am guessing that somewhere between Git and MsysGit, there is some misconfiguration or miscommunication.

Daniel Peñalba
  • 30,507
  • 32
  • 137
  • 219
glenatron
  • 11,018
  • 13
  • 64
  • 112
  • Can you try and repeat your merge *after* setting the environment variable `GIT_DIR` to `/path/to/your/repo/.git`? From a shell: `GIT_DIR=/path/to/your/repo/.git && git merge xxx`. – VonC Aug 19 '13 at 15:22
  • You should add your `.gitconfig` for SemanticMerge to your question, in case it's been misconfigured. –  Aug 19 '13 at 17:11
  • @Cupcake I thought of doing that but then it really is pretty much the same as the above link. I will try both of these next time I have a conflict come up. – glenatron Aug 20 '13 at 12:37
  • @VonC if I set GIT_DIR to the path to my repo, git extensions fails altogether and thinks the repository is empty. – glenatron Aug 28 '13 at 15:59

1 Answers1

4

I'm not sure if the SemanticMerge configuration is your issue, but if it is, you can try using these settings. I have it working on my work machine, but these are my personal machine settings, so they might not have been updated yet. These settings are for msysgit on Windows 7 by the way:

[mergetool "sm"]
    keepBackup = false
    trustExitCode = false
    cmd = 'C:/Users/<user>/AppData/Local/PlasticSCM4/semanticmerge/semanticmergetool.exe' -b=\"$BASE\" -d=\"$LOCAL\" -s=\"$REMOTE\" -r=\"$MERGED\" -l=csharp -emt=\"mergetool.exe -b=\"\"@basefile\"\" -bn=\"\"@basesymbolic\"\" -s=\"\"@sourcefile\"\" -sn=\"\"@sourcesymbolic\"\" -d=\"\"@destinationfile\"\" -dn=\"\"@destinationsymbolic\"\" -r=\"\"@output\"\" -t=\"\"@filetype\"\" -i=\"\"@comparationmethod\"\" -e=\"\"@fileencoding\"\"\" -edt=\"mergetool.exe  -s=\"\"@sourcefile\"\" -sn=\"\"@sourcesymbolic\"\" -d=\"\"@destinationfile\"\" -dn=\"\"@destinationsymbolic\"\" -t=\"\"@filetype\"\" -i=\"\"@comparationmethod\"\" -e=\"\"@fileencoding\"\"\"
  • Adding this to the .git\config folder in my repo seems to have solved the problem to the extent that I can use it from the "merge" command line if not from GitExtensions. – glenatron Aug 28 '13 at 16:29