New tool to play with: SemanticMerge

A little while ago I was contacted about a new merge tool from the company behind PlasticSCM. (I haven’t used Plastic myself, but I’d heard of it.) My initial reaction was that I wasn’t interested in anything which required me to learn yet another source control system, but SemanticMerge is independent of PlasticSCM.

My interested was piqued when I learned that SemanticMerge is actually built on Roslyn. I don’t generally care much about implementation details, but I’m looking out for uses of Roslyn outside Microsoft, partly to see if I can gain any inspiration for using it myself. Between the name and the implementation detail, it should be fairly obvious that this is a tool which understands changes in C# source code rather better than a plain text diff.

I’ve had SemanticMerge installed on one of my laptops for a month or so now. Unfortunately it’s getting pretty light use – my main coding outside work is on Noda Time, and as I perform the vast majority of the commits, the only time I really need to perform merges is when I’ve forgotten to push a commit from one machine before switching to another. I’ve used it for diffs though, and it seems to be doing the right thing there – showing which members have been added, moved, changed etc.

I don’t believe it can currently support multi-file changes – for example, spotting that a lot of changes are all due to a rename operation – but even if it doesn’t right now, I suspect that may be worked on in the future. And of course, the merge functionality is the main point.

Post navigation

3 thoughts on “New tool to play with: SemanticMerge”

Recently I have been interested in Roslyn, and I’m amazed about the possibilities it offers. I have in mind some search integrated in visual studio. But with semantics. R# have a little in that direction, but I think I can go way deeper.

So this one is a really awesome idea of a product. Will try to tell my comrades to use it.

If you’re looking for novel uses for Roslyn then I’d recommend using it as a code re-writing tool.

I used it do a large refactoring over 200 files. The change involved removing about 4 properties including regions and comments, inheriting from a newly created base class and passing the value of those 4 properties into the constructor for the base class.

There were a few edge cases that it didn’t catch but it did the bulk of the work and I cleaned up the remaining code by hand.

If you were really ambitious I’m sure you could use it to implement a kind of compile time AOP (inserting the AOP stuff in code rather than in CIL) but I haven’t had a need for doing that so I haven’t looked at it.