2

I'm wondering if there is a way to setup git and diffmerge so that when you execute the following command: git difftool diffmerge pops up and shows you a file listing of all the modified files instead of cycling through them via the command-line?

I'm thinking it must be some setting the ~/.gitconfig file. Here is my current ~/.gitconfig:

[merge]
    tool = diffmerge
[mergetool "diffmerge"]
    cmd = /Applications/DiffMerge.app/Contents/MacOS/diffmerge --merge --result=$MERGED $LOCAL $BASE $REMOTE
[mergetool]
    keepBackup = false
[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = /Applications/DiffMerge.app/Contents/MacOS/diffmerge $LOCAL $REMOTE

See below for Mercurials (HG) way of presenting DiffMerge. Mercurial's way of diffmerge

Bryan
  • 584
  • 1
  • 7
  • 18
  • I think what I'm looking for is the "folder diffs" that Mercurial and DiffMerge allows, and for some reason git doesn't, or I don't know how to set that up. – Bryan Aug 15 '11 at 19:26

4 Answers4

1

Note that you now can (git 1.7.11) diff directories (ie display all the files to be compared, before opening the difftool)

See "git difftool to give directory compare?"

In other words, git now does "inherently handle folder diffs."

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • How will that work with a 3 way merge tool such as DiffMerge? – Bryan Jun 19 '12 at 21:16
  • @Bryan `git diff` and `difftool` are about two-way diffs (as mentioned in http://stackoverflow.com/questions/7251477/git-diff-whats-the-difference-between-having-and-no-dots and http://stackoverflow.com/questions/3635788/doing-a-three-way-compare-with-git-and-kdiff3). That option won't concern `mergetool`, which will show a three-way diff, but without using the `difftool` setting (hence ignoring the new `difftool` option `--dir-diff`). – VonC Jun 19 '12 at 22:42
1

You should have the following lines in your .gitconfig:

[diff]
    tool = diffmerge
[difftool "diffmerge"]
    cmd = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge \"$LOCAL\" \"$REMOTE\"
Edward Thomson
  • 63,947
  • 11
  • 134
  • 169
1

Git does not provide directory diffs in its default setup. See this related SO question:

git difftool, open all diff files immediately, not in serial

Also, see the git diffall project on GitHub which implements this feature as an add-on script.

Community
  • 1
  • 1
Tim Henigan
  • 55,120
  • 11
  • 81
  • 76
  • Perfect. This is exactly what I was looking for. Its too bad git doesn't inherently handle folder diffs. – Bryan Aug 23 '11 at 18:39
0

Take a look at the question and answer here for details regarding setting up git with diffmerge:

Problem with git + DiffMerge on OS X

Community
  • 1
  • 1
Gerry
  • 9,339
  • 3
  • 36
  • 47