Using OS X FileMerge/opendiff to view git differences, loading all files at once in the directory view

纵饮孤独 提交于 2019-12-25 14:29:49

问题


We are version controlling our project using git. Developing under OS X, we'd like to use the FileMerge application distributed with the development tools to display git generated differences:
If we understood correctly, it is possible to configure its invocation through git difftool.


Following advices from different sources, we added this in our global git configuration file:

[diff]
    tool = opendiff

It works well for "file by file" diffs. But we prefer to have a directory difference loaded at once in the tool, for which the command is git difftool --dir-diff.

When invoking the directory diff command, the list of different files in correctly generated, but if we actually try to open one file, both sides show the error files does not exist. Apparently, this is because opendiff is terminating almost immediately, thus having git remove the temporary folders on which the comparison occurred.

Following this answer, we added those lines to our global git configuration file:

[difftool "opendiff"]
    cmd = /usr/bin/opendiff \"$LOCAL\" \"$REMOTE\" -merge \"$MERGED\" | cat

But it does not solve the file does not exist problem (and opendiff still returns almost immediately).

What would be the correct configuration for this use case ?


回答1:


The problem is Filemerge is filtering out the .git directory, which is where git is storing the directory used in the output of --dir-diff.

In Filemerge, go to Preferences > Filters and remove .git from Files to ignore and it should work.



来源:https://stackoverflow.com/questions/33955712/using-os-x-filemerge-opendiff-to-view-git-differences-loading-all-files-at-once

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!