Kinetic Merge 0.2.0


I’m working on an open-source command line utility for merging files across Git commits, taking into account code motion that has taken place in separate branches: Kinetic Merge.

That way if you do some heavy refactoring on one branch, and your colleague does some bug fix on that code on another branch, you can merge their changes without seeing odd little islands of code pop up in strange places in the merge.

It’s written in Scala, and it is published as both a command line application using Coursier to pull down its dependencies, and as a library so that you can embed it in your own tooling stack. Hopefully that will get this post past the moderation police…

Anyway, I’ve got to the point where there is something to play with - it’s had a fair bit of work done on it, and a lot of blood, sweat and tears on automated testing, plus I’ve been dogfooding it on another project of mine.

Would anyone fancy subjecting it to their tender mercies on their own project? I’m sure someone out there will do their utmost to break it :smile:

To set expectations, what it does now (version 0.2.0) is try to be a slightly better Git merge tool; the code motion aspect isn’t fully implemented end to end, but a lot of groundwork for it lives in the current codebase; I’m keen to get it out there and hear of people’s experiences prior to starting on the next big development push.

If you have feedback, please raise an issue and I’ll see what I can do: there is a master ticket for this here: Dogfood Testing - Issue 21. If you can’t minimise the problem, no bother, as long as your repository is public then just mention the branches / tags you’re merging and I can take a look.

I’m interested both in obvious bugs and situations where the merge results don’t quite look right.

Instructions for installation are on that ticket and also on the project README, as well as some advice to keep your precious repository safe.

(PS: if there is a better place for announcing this, be it either as part of the Scala groups or elsewhere, do let me know - if you’re reading posts here, you’re probably writing software, so I may as well start here).

Hope you find it useful…


An update - releasing a minor update 0.2.2 which allows merges to be performed from JShell.

This is in case anyone wants to try a merge in an environment where downloading arbitrary executables off the Internet is frowned upon, but Maven Central is OK, and they don’t have Coursier either to do a cs launch.

Don’t do this the day you release to production, though.

I’ve updated the ticket Dogfood Testing - Issue 21 with instructions for JShell.

1 Like

Kinetic Merge 1.0.0 has been released. Now it’s in beta!

Intra-file code motion is supported - I’ve commemorated this with a screencast of it in operation, split into three parts on Github: Kinetic Merge.

Next stop, supporting inter-file code motion…


Kinetic Merge 1.1.2 has been released. It’s still in beta!

Finally, inter-file code motion has is supported - changes can be merged across code motion between files.

I’ve made a demonstration of merging changes made on another branch into a branch where code has been refactored by excising out some factory methods into their own file, keeping some of the original code in its old home.

Watch those changes propagate: Kinetic Merge: Merging through a File Split.

The example code is some Java in Americium - that’s a mixed Scala and Java project.

It works on Scala code too. Hint, hint.

1 Like

Kinetic Merge 1.2.0 has arrived.

We have a release candidate!

You can make code changes - be they edits, deletions or insertions on one branch, and merge those changes through code motion on another branch.

Code motion includes moving code around in the same file, renaming or moving entire files, splitting files into pieces and condensing smaller files together.

Bug reports are welcome, see: Dogfood Testing. · Issue #21 · sageserpent-open/kineticMerge · GitHub.

Currently, merging through code motion in languages with significant indentation - say, Python or Scala 3 with the new syntax enabled - can be a bit of a gamble. There’s a ticket for that here: Adjust indentation when migrating edits or insertions. · Issue #41 · sageserpent-open/kineticMerge · GitHub, if anyone wishes to lobby for it.

May your changes follow in the footsteps of others’ refactorings…