Skip to content
  • Florian 
  • 6 min read

Kaleidoscope 4.1 and Git

With the first major update to Kaleidoscope 4, we are entering completely new territory: Kaleidoscope can now directly talk to Git. While Kaleidoscope could always integrate with Git, until now it could only show the results of a Git operation, such as git difftool and git mergetool, which was typically initiated through a Git client like Tower.

While this was a bit of a challenge, we are very happy with the results. And it could not be simpler to use.

Compare multiple versions of a file right inside Kaleidoscope

Git integration opens up so many cool possibilities. For the 4.1 update, we decided to focus on the ability to display and compare multiple revisions of a file. Let’s look at how flexible and powerful this new functionality is.

When opening a single file that happens to be inside a Git repository, you’ll notice a few changes.

This screenshot shows the Package.swift file of the swift-markdown package hosted by Apple on GitHub. Note the new File History inspector on the right side of the window, showing all commits related to that file.
  1. In the B side content area, there is a button Compare with Previous Version, below Drag File(s) Here.
  2. There’s a new inspector on the far right hand side of the window: File History. It shows all revisions of that file in the Git repository. Much more on that below.
  3. If you look more closely, you’ll also notice a new toolbar icon to toggle the File History.
  4. There is also new File History command in the application View menu to complement the new toolbar icon. You may also use ⇧⌘H to quickly toggle the File History.

When you click the Compare With Previous Version button, Kaleidoscope compares the last two versions of that file:

Kaleidoscope comparing the last two git revisions of the Package.swift file of https://github.com/apple/swift-markdown
Notes
  • The second entry in the File History on the right is now highlighted with color, indicating it is being displayed, too.
  • Kaleidoscope automatically moved the file that you initially opened to side B. By default, Kaleidoscope tries to show the older item in side A and the newer one in B, as the semantics of removed and added are more natural this way.
  • You can of course explore and compare any two versions by choosing from the File History, either by clicking the A or B buttons or via other methods described below.
  • You can even add a different file to the document and then compare Revision X of that file with Revision Y of the first file. There are almost no limits to the comparison possibilities.
Two Git commits, the newer one (from 2023, on top) shown in B, the older one (below, from 2022) in A.

The File History

Let’s inspect the File History a little closer. As you would  expect, it lists commits, sorted by date. Each entry shows the most important bits of that commit. Use the A/B chooser of any entry to propagate that version into the side you want. Clicking the entry shows a popover with more details:

The details of a single commit. Click the A or B buttons to show that revision in A or B. Click Compare with Previous to show that revision in B and the one below in the File History in A. This way you can see all changes made to that file in this commit.

Also note that each entry in the File History offers a contextual menu to access convenient options.

Below the File History entries, there are two more useful functionalities:

  1. The Filter field allows quick filtering of the commit list. Enter text to search in authors, commit hashes, dates, and the commit message. For example, entering your name will filter the list to show only your commits.
  2. The branch button in the bottom right allows you to look at a different git reference, such as a specific branch or tag. Selecting an entry will reload the list and show commits for that reference.
The branch button lets you choose a specific branch or tag for inspection.
Kaleidoscope General Settings

Settings

There are two new settings in the General Settings view that let you configure the default behavior when opening files that are part of a Git repository:

  • Load and Show the File History lets you decide if you want to automatically show the File History inspector when opening a file that is inside a Git working copy. You can always manually toggle it, independent of that setting.
  • Compare the Most Recent Versions toggles automatically comparing the opened file with the most recent revision before that. When disabled, the Compare With Previous Version button will be displayed on side B. (See the first screenshot, above.)

Other Changes

As you play with Kaleidoscope 4.1, you will likely notice that the File Shelf also received some updates to accommodate these new kinds of files. And you’ll notice that we also added these new documents to the Recents list, to support the default case of showing the last versions of a file.

The Beginning

We are confident that a lot of you can make good use of these additions to Kaleidoscope. And we are also sure that you’ll have ideas on how to improve these features and add others that help you be more productive and have more fun with Kaleidoscope. Let us know—we are eager to hear!