Skip to content
  • Florian 
  • 7 min read

Kaleidoscope 5.2 eases the process of resolving merge conflicts by offering Base to A / B Comparisons, and more

Kaleidoscope 5.2 adds news tricks to support you even better when dealing with merge conflicts, in particular Git merge conflicts.

The Base File in Merges

Git merges typically come with a base file, that’s the common basis of a file before the work diverged, likely in separate git branches. This diverged work may ultimately lead to a conflict when trying to merge one branch into another.

See an illustration of the various terms involved on the side. Lines represent branches, circles are commits, and dashed lines represent merges. You start to work on a feature in a new branch. At the same time, other work gets done on the main branch. The commit named Base is the common basis before main and feature started diverging into different directions. Before wrapping up work on the feature and bringing the work back to main, you typically merge main into feature, to ensure your work can be merged back to main. But this may cause a Merge Conflict, where some changes in certain files can’t be merged by Git. This is when fun starts!

While Kaleidoscope has always automatically resolved some conflicts using the Base file provided by Git, it lacked the ability to display that file directly. Some merge tools display the Base file alongside the input files and the merge file. However, we never favored this approach because it further complicates the conflict resolution process by presenting you with four rather similar files simultaneously instead of the already confusing three.

But what if you were able to show the Base only in cases where you actually need it? And what if you were able not only see the Base itself, but instead compare what changed between Base and side A or B? After all, why should you try to figure out the difference between Base and A or B while having a diff app at your disposal? And what if, only in cases where that short comparison is unclear to you, you were able to then compare the entire files and inspect what changed between those versions, commit by commit?

Kaleidoscope 5.2 offers exactly all of that. Let’s dive in!

Showing the Base to A/B Comparison for a Conflict

To illustrate the features, I created a conflict using the Swift project on GitHub, by merging the (no longer existing) dumb-version-6.0.1 branch into main. We are looking at a random Swift file, aptly called Random.swift. Unless you are very familiar with the project and its changes, it may not be intuitively clear why there is a merge conflict in line 160/161.

Kaleidoscope showing a merge conflict in line 160/161.

Inspecting the last commits shown in the Kaleidoscope Merge Shelf, you may already get a hunch what is going on. But still, you don’t know what the exact change was (or what the changes were?) since the work in those branches started to diverge.

Clicking the left header in the Merge Shelf shows details for the last commit on that branch that led to the conflict.

As of Kaleidoscope 5.2, when merging text files that come with a Base, you see two new buttons in the bottom toolbar to toggle the Base to A Comparison and the Base to B Comparison. You’ll also find new commands Show Base to A Comparison and Show Base to B Comparison in the View menu.

The two ways to show the new Base to A/B Comparison: Commands in the View menu and buttons in the bottom toolbar.

Clicking the Base to A Comparison button shows the exact change between the Base file and (in this case) file A, the file representing the commit that last changed that particular file on the main branch:

The new Base to A Comparison popover, shown for the context of the selected conflict.

Kaleidoscope tries to be smart (even without the use of any AI – yes, that’s still an option in 2024!) and show you a tiny bit of context, such adjacent changes, and one line before and after the change.

If you need even more context, click the Compare Entire Files button, which will open a full comparison of the base and the top changes in that branch in a new tab of the same window.

The full Base to A comparison, including the Git File History shown on the right, with the Base and the top commit selected.

See the Git History between Base and Head Commit

On the right side you will see the Git History of that file, with the two commits already selected. Base is shown in side A and the top change is shown in B.

From there, you can inspect all intermediary changes and learn how the conflict came into existence. Simply click the A and B buttons in the History entries to change comparisons, or use the various Navigate > File History menu commands to step through the history. Depending on how long a feature branch lasted, there can be a lot to explore.

To see the same comparison between the Base and B (the head of the other branch), go back the previous tab and do the same again, this time starting with the Base to B Comparison button, then clicking Compare Entire Files to open the full comparison between the Base and the top commit of the other branch, bump-version-6.0.1 in our case.

Note that you can also (option) click the toolbar button (or select the menu command View > Open Base to B Comparison with held down) to immediately get to the full comparison without going through the popover.

The entire Base to B comparison with the Base commit selected in the Git File History.

In this example, there was no additional commit in-between, the top change commit immediately followed the Base commit for that Random.swift file in the Git History.

Also note the head icon in the history entry, indicating that this commit was “inserted” from another branch into this history. Here, we are looking at the Git History of the bump-version-6.0.1 branch, but that Base commit came from the main branch, as shown in the commit detail popover.

From there, you can further explore the history of the repository, e.g. by opening the entire changeset for a commit or by jumping to tickets referenced in the commit message, providing you with yet more background knowledge for a change.

Also new in Kaleidoscope 5.2: if a commit has multiple parents, clicking the Open Changeset button will now show a menu and let you choose which changeset to open. Yes, Git can be intimidating at times.

We believe that all those changes give you much better understanding complex conflicts, thus helping you to resolve those conflicts faster and with more confidence.