2

I wanted to set my git to use diffmerge as the default diff editor instead of the default Unix diff:

git config --global diff.external diffmerge

Undfortunately, when I did

git diff myfile.txt

I got the following error out of DiffMerge (in the form of a popup):

Unexpected parameter '100644'

Command Line Arguments:
[0]: /Applications/DiffMerge.app/Contents/MacOS/DiffMerge
[1]: --nosplash
[2]: myfile.txt
[3]: /var/folders/_r/xjwgmj811yq5x7n7mb9z0pzc0000gn/T//pNIOTmyfile.txt
[4]: 95cbe334d3ec607ca7f7bd3fd16d630271e9d0af
[5]: 100644
[6]: myfile.txt
[7]: 0000000000000000000000000000000000000000
[8]: 100644

Can you tell what I am doing wrong?

amphibient
  • 25,192
  • 44
  • 130
  • 215
  • possible duplicate of [How do I view 'git diff' output with a visual diff program?](http://stackoverflow.com/questions/255202/how-do-i-view-git-diff-output-with-a-visual-diff-program) – Edward Thomson Feb 04 '14 at 19:03

1 Answers1

1

Use this instead

git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd "diffmerge \$LOCAL \$REMOTE"

There is plenty of blog posts and articles explaining how to configure diffmerge as default diff or merge tool. See http://adventuresincoding.com/2010/04/how-to-setup-git-to-use-diffmerge/ for example

Antwane
  • 15,262
  • 5
  • 37
  • 71
  • actually, it works fine when i do `git difftool` rather than just `git diff`. the only annoyance is that it asks me to confirm Y/N if i want to pop up diffmerge. is there any way to override the confirm (always be yes) by default without piping an echoed Y into it? – amphibient Feb 04 '14 at 19:15
  • 100644 seems to be a classical file mode in git. There is many references to it in git book. For example http://git-scm.com/docs/gitdiffcore – Antwane Feb 04 '14 at 19:16
  • really ? https://stackoverflow.com/questions/7897517/why-git-difftool-does-not-open-the-tool-automatically – Antwane Feb 04 '14 at 19:17
  • You also already had an answer for the same question... https://stackoverflow.com/questions/21486481/is-it-possible-to-view-git-diffs-using-a-gui-side-by-side-tool-on-mac – Antwane Feb 04 '14 at 19:20
  • not exactly, didn't explain `difftool.diffmerge.cmd` – amphibient Feb 04 '14 at 19:24
  • what i ended up doing is just using the 2nd command (`difftool.diffmerge.cmd`). that way, when i want the GUI i do `git difftool -Y` and when i want to spit it into the STDOUT i do `git diff` – amphibient Feb 04 '14 at 19:25