3

Let's say I have some directories with symlinks in them.

.
├── dirA
│   ├── file013
│   └── file212
└── dirB
    ├── file013
    └── file212

2 directories, 4 files

The symlinks are pointing to directories with lots of files and directories that I don't care about, so I've used symlinks to isolate them. I can edit them just fine, for example, and the changes are done on the actual files.

I want to compare say A.file013 <> B.file013

Oh, I and I mostly work from the terminal, so looking for

$ awesome_diff dirA/file013 dirB/file013 : diff 1 file pair

  • opendiff/Filemerge does do this, actually. ✅ so does ksdiff/Kaleidoscope.

and

$ awesome_diff dirA dirB : diff at directory level.

  • compare directory contents, drill down into directories, drill down into individual file diffs....

    • opendiff/Filemerge fails this ❌ as it will then consider only the symlinks' own pointers. ksdiff/Kaleidoscope also ❌

(still appreciate GUI-only answers)

good:

  • Gnu diff : does a fine job, but terminal-only. Most GUI diff tools provide line by line copy functionality.

bad:

  • Apple Filemerge/opendiff compares symlink file pointers, not file contents. actually, if you launch Filemerge, the GUI, from the start it does work, but the command line opendiff calls the Filemerge incorrectly.

  • Kaleidoscope - file type (symlink) not supported

unknown/install issues:

  • Kdiff3 - compares, but otherwise broken at 0.998 release, the menu doesn't work at all for example.
  • Meld - haven't gotten it to work on macos yet.
  • Diffmerge - haven't gotten it to work on macos yet.

env: Mojave

  • I just tried with Filemerge. When selecting symlinked files in the Open Dialog, the tool follows the symlink and compares the files they point to. – nohillside Feb 29 '20 at 18:24
  • Nice to know. but that's pretty brutal in terms of workflow when you are in the terminal all the time like me. Launch it, then pick left file, pick right file. It does remember last working directory, but the other one is always going to be wrong. Still, if you write it up (copy paste comment will do, definitely upvoting). and editing my question to clarify. – JL Peyret Feb 29 '20 at 18:32
  • It also works for opendiff, not sure why it doesn't seem to work in your case. – nohillside Feb 29 '20 at 18:37
2

Both Filemerge and opendiff work with symlinks, so

opendiff symlink-to-foo symlink-to-bar

will open Filemerge and compare foo vs bar .

  • 1
    ah, interesting. opendiff dirA dirB, then look at folder contents and drill down into files doesn't work - once you pick your files they resolve to symlinks. however, opendiff dirA/file013 dirB/file013 does. – JL Peyret Feb 29 '20 at 18:44
  • same behavior from ksdiff/Kaleidoscope. – JL Peyret Feb 29 '20 at 18:50
  • let's see what else pops up, but if no else chimes in any better ideas, I can live with this. I would really prefer the same behavior you get from comparing 2 directories with normal files, but, well, beggars can't be choosers. – JL Peyret Feb 29 '20 at 18:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .