I\'m following the docs from the Git configuration page and trying to apply this to my Windows 7 environment. When I run say, \"git diff file0\" I get an error in P4Merge:>
The correct solution would be using Cygwin's cygpath
tool to convert path formats:
[difftool "p4merge"]
cmd = p4merge \"$(cygpath -w \"$LOCAL\")\" \"$(cygpath -w \"$REMOTE\")\"
The same goes for mergetool:
[mergetool "p4merge"]
keepBackup = false
trustExitCode = true
cmd = p4merge \"$(cygpath -w \"$BASE\")\" \"$(cygpath -w \"$LOCAL\")\" \"$(cygpath -w \"$REMOTE\")\" \"$(cygpath -w \"$MERGED\")\"
Please note that this solution (as well as the question, actually) applies only to Cygwin environment. I've never had Git Bash exhibit the same problem and don't know if it has a utility similar tocygpath
.
UPDATE: Unfortunately, the cygpath
utility does a poor job converting /dev/null
to its Windows equivalent. It will return the invalid \\.\NUL
path, and so diffing new files will fail. I'll issue another update with the workaround, as soon as I find it.