Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Diff and Merge using FileMerge Apps
Apple ships an application FileMerge with the developer tools CD which is certainly of use to people, developers or not. You can even call it from the command line. To call it from the command line to diff (editor: compare two files showing the differences between them) two files, use:

/Developer/Applications/FileMerge.app/Contents/MacOS/FileMerge[space]
-left <file1> -right <file2>

(Enter the above as one line, replacing [space] with an actual space character). You can put it in a shell script by creating a file in your ~/bin directory with execute permissions containing:

#!/bin/sh
/Developer/Applications/FileMerge.app/Contents/MacOS/
FileMerge -left $1 -right $2

(everything from /Developer... through $2 should be entered on the same line). You can also use this program to merge from the command line by creating a shell script containing:

#!/bin/sh
/Developer/Applications/FileMerge.app/Contents/MacOS/FileMerge[space]
-left $2 -right $3 ancestor $1 - merge $4

(everything from /Developer... through $4 should be entered on the same line)
    •    
  • Currently 2.50 / 5
  You rated: 2 / 5 (4 votes cast)
 
[14,491 views]  

Diff and Merge using FileMerge | 2 comments | Create New Account
Click here to return to the 'Diff and Merge using FileMerge' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
or you could
Authored by: amishra on Nov 01, '01 11:44:39AM

just type

opendiff <file1> <file2>

or for entire directories

opendiff <dir1> <dir2>



[ Reply to This | # ]
Shell script woes
Authored by: smurf on Nov 02, '01 02:29:36AM

Or, if you do write a shell script, enclose ALL file names in double quotes.

WRONG:

#!/bin/sh
run_me $1 $2

CORRECT:

#!/bin/sh
run_me "$1" "$2"

If you forget that, nasty surprises will get you.



[ Reply to This | # ]