FileMerge help unavailable

When using FileMerge inside or outside Xcode, any Help queries put up a box that says "this content is not available right now."


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?

Posted on Dec 17, 2023 7:56 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 17, 2023 1:42 PM

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.


2 replies
Question marked as Top-ranking reply

Dec 17, 2023 1:42 PM in response to Grant Bennet-Alder

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.


Dec 17, 2023 11:31 AM in response to Grant Bennet-Alder

Not entirely sure what you're asking...


The use-left means use the source code highlighted in the left source file in the merged source code result.


The tool allows selecting either left or right difference for the merge.


Some of what little documentation is available for this NeXT-era tool:

... http://schwehr.org/blog/archives/2008https://sourcegear.com/diffmerge/

... https://ehttps://www.perforce.com/products/helix-core-apps/merge-diff-tool-p4merge


From inside Xcode:

... Combining code changes in a source control repository | Apple Developer Documentation


I ended up buying Kaleidoscope for this a very long time ago, but haven't been using that app in recent times.


There are other options, including P4Merge and DiffMerge, and there are paid options including Kaleidoscope.

... https://www.perforce.com/products/helix-core-apps/merge-diff-tool-p4merge

... https://sourcegear.com/diffmerge/


I've also used the command-line patch/diff tooling for this. That's handy for sending out diffs, which is helpful when distributing source changes while staying within some particular app's copyright distribution restrictions.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

FileMerge help unavailable

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.