Grant Bennet-Alder wrote:
When using FileMerge inside or outside Xcode, any Help queries put up a box that says "this content is not available right now."
Can you describe how you are using FileMerge inside Xcode? Xcode really doesn't use FileMerge anymore.
I just checked it Ventura with Xcode 15.1 and it works fine. As it is an older app, it has extensive help available. But it's older, so no dark mode support in the help window.
I am trying to compare two files, and there are some small differences, mostly additions. But what is not obvious to me is how to actually effect adding the differences from one version into the other, or into a merged version.
Little numbers and 'use left', 'use right' are not quite adequate for this novice user of the program. How do I tell the program to use one version's difference over the other version's differences?
I'm afraid that use left and use right are all there is. You just have to arrow through the changes and hit left arrow or right arrow to pick the one you want.
There is an important trick to it. It's best to run it from the command line. That way, you can easily set the merge target. You can type the command like so:
opendiff /path/to/file1 /path/to/file2 -merge /path/to/merged/file 2> /dev/null
It spits out lots of junk, so the h"2> /dev/null" is to get rid of that.
You can use the same path for "/path/to/file2" and "/path/to/merged/file". That way, you can quickly scan through the changes, using left and right arrow keys to pick the changes, and the command-s to save, updating the file.
Normally I use it when comparing directories with something like this:
diff -r --brief --exclude=.git /path/to/dir1 /path/to/dir2
Then, I have a script called "xcodediff" that does this:
#!/usr/bin/perl
use strict;
my @files;
my $last;
foreach my $file (@ARGV)
{
next
if $file eq 'Files';
next
if $file eq 'and';
next
if $file eq 'differ';
if($file =~ /^".+"$/)
{
push @files, $file;
}
else
{
push @files, qq{"$file"};
}
$last = $file;
}
# Now run opendiff with the previous version and the current version.
system(qq{opendiff @files -merge "$last" 2> /dev/null});
Now I can just select one of the lines from my directory compare output and feed it right into FileMerge.