The command line diff tool produces textual diffs. These are not useful for visualizing complicated changes.
However, the Apple Developer Toolset includes a pretty good graphical diff tool called FileMerge. You can pop open
FileMerge from the command line with the command opendiff
.
The use of opendiff is fairly simple … just type opendiff file1 file2
at the OSX command line, and a graphical diff
window pops open.
But when we are working with version control tools, and we want to view which changes we have made to a file … a diff is generated by the version control software itself … so there aren’t two files to easily diff …
However, you can integrate opendiff into mercurial, so that when you type hg diff
, you see a diff pop up in opendiff.
I got this information from the mercurial wiki
I got this working with the following procedure:
cd ~/Desktop
svn co http://soft.vub.ac.be/svn-gen/bdefrain/fmscripts/
cd fmscripts
sudo make install
mate ~/.hgrc
- Paste the configuration lines from that mercurial wiki referenced above into the
.hgrc
file, save, and exit.
Now you can type:
hg opendiff file
And see the results in opendiff: