Better File Comparison with Kaleidoscope
Table of Contents
Diff tools have a simple but important task: to highlight the differences between two files, so that we can quickly identify what was added, changed, or removed. This is crucial in a collaborative environment, where multiple people are focused on moving the project forward and we need to quickly understand what changes occurred.
That's why a dedicated Diff Tool can be a great companion app for developers! Today, we'll explore some features that set Kaleidoscope apart.
The original diff
utility was developed in the early 1970s and shipped with the 5th Edition of Unix. We've come a long way since then, of course, with multiple apps (such as code editors) offering good diffing support, either natively or via plug-ins.
Tower, our Git client, is another good example: it can compare not only differences in text but also in images (it supports PNG, JPG, GIF, BMP, TIFF, JPEG2000, and HEIC).
While this should be sufficient for some folks, you may need support for more file formats, like PDF or Word, the possibility of comparing entire directories side by side, or more customizable viewing options to comprehend what changed more conveniently. That's where a Diff Tool comes in handy!
There are several free and paid Diff Tools available for the Mac. In this post, we'll focus on Kaleidoscope, the most popular tool out there for macOS (according to our recent Mac Dev survey) — that works seamlessly with Tower!
Getting Started with Kaleidoscope 3
Kaleidoscope can be downloaded from the Mac App Store or directly from the official website. You can try it for free for 15 days, so anyone can follow along and try all these features free of charge.
After installation is complete, you'll be presented with an onboarding screen highlighting some of Kaleidoscope's advanced features and integration options.
Here, we recommend installing the ksdiff
command-line tool (a requirement for other integrations to work, even if you don't plan to use the terminal) and making Kaleidoscope the default diff and merge tool.
Simply head over to the "Git" section and click on both buttons:
You will also notice that Kaleidoscope provides plenty of integration options — not only for macOS's system tools, such as Services, Shortcuts or the Share Extension, but also for Xcode, Safari, VSCode and even Alfred, to name a few. You can even use the Clipboard to import files!
Let's switch gears for a brief second and also set Kaleidoscope as the default Diff and Merge tool in Tower. That way, we can quickly open any file with Kaleidoscope by right-clicking a file and selecting "Open Diff Tool for [FILE]", among other actions (more on that later).
We just need to open Tower's Preferences and choose the "Git Config" tab.
Exploring Kaleidoscope's Features
As a standalone application, Kaleidoscope can already prove itseful quite useful. Before we see how we can use it together with Tower, let's have a look at some of its nifty features.
Working with Text
Most developers will perform some kind of text comparison most of the time, so it makes sense to cover this first. Kaleidoscope offers a great deal of detail and customization on how to visualize text diffs, such as showing/hiding line numbers, invisible characters or whitespace.
It also provides three different layouts: Blocks, Fluid (my favorite!), and Unified. You can switch views by accessing the top right corner.
Working with PDF and Word Documents
We don't always work with source code — wouldn't it be nice to check the diffs on some Word and PDF documents? Thankfully, Kaleidoscope has got us covered!
Kaleidoscope extracts and compares text from many document formats — stripping away all the formatting and leaving us with just plain text, perfect to spot any modifications quickly.
Look at the example below. Kaleidoscope treats this .DOCX file just like plain text. This can be a convincing argument for Marketing teams to adopt Git!
Image Diff
Time to compare two images with Kaleidoscope! Just like in Tower, you can compare both images side by side ("Two Up View") or in isolation ("One Up View"). What's new here is that you can also go for "Split View" or even "Difference View".
"Split View" will let you set a custom shape so that you can analyse an image in greater detail:
"Difference View" is the preferred option to pinpoint very subtle differences, as it will offer a high contrast "difference mask" with opacity sliders that you can control.
With Kaleidoscope's "File Shelf" feature, you can open multiple images at the same time and quickly A/B any set of images you may need. "Zoom" and "Move" tools are also provided for any of these four views, making this a great tool for photographers and designers as well.
Comparing Folders
Kaleidoscope isn't just for files — you can compare entire folders, too. Drag and drop any two folders to visualize the differences. In this example, we can see that kaleidoscope.md
has been modified (in blue) and that 2 images are missing in folder B (in red).
By clicking on the missing/modified files, you can conveniently copy them to the other folder. You can use Kaleidoscope as a backup sync tool.
The filters on the top right enable quick toggling to filter changed, equal, and unmatched items.
Integration with Tower
Kaleidoscope is tightly integrated with Tower. It can be particularly useful when the time comes to:
- Review changesets.
- Solve merge conflicts.
Let's see how we would use the two applications together to perform these actions.
We make Tower, the best Git client.
Not a Tower user yet?
Download our 30-day free trial and experience a better way to work with Git!
Reviewing Changesets
When it comes to reviewing changesets, no other Diff tool works as nicely as Kaleidoscope. Once set as the default Diff tool in Tower's "Preferences" window, you can quickly launch it within Tower for quick comparisons.
You will often want to inspect what changed in older commits. In Tower's "History" view, select the commit that piqued your interest and click on the "DIFFTOOL" button. It's that easy!
Need to compare it to a different revision? No problem! Just right-click that commit and click on "Compare [REVISION] to Revision...".
Reviewing changesets doesn't have to be exclusive to commits. You can analyze items in the Working Copy by right-clicking the "Working Copy" view directly and selecting "Compare".
Solving Merge Conflicts
Nobody likes merge conflicts in Git, but they're becoming easier and easier to solve. Tower provides a dedicated conflict wizard for some visual help, and you can use Kaleidoscope to take this even further!
Since we set Kaleidoscope as our default Merge tool in Tower's "Preferences" window earlier, we can now easily open the conflicting file directly in our favorite Diff tool:
To fix a merge conflict, Kaleidoscope will ask you to "Choose A" (the option on the left) or "Choose B" (the option on the right) — the resolved document will appear in the middle with the choice reflected.
You can also edit the file directly inline, for those times when neither one of them is the right choice.
Final Words
As you can see, there's a lot to like in Kaleidoscope — and we only scratched the surface! Make sure you have a look at the many available integrations, such as Alfred, Xcode, Safari, or VS Code, for more advanced usage.
To learn more features and tips, visit Kaleidoscope's official website or check out @kaleidoscopeapp on Twitter.