The term “semantic” has long been a buzzword for the Web crowd. Tim Berners-Lee has long predicted the arrival of the Semantic Web: that is, a Web that understands its own content. While Google and others work at understanding the Web, Codice Software, maker of Plastic SCM, is now offering Semantic Merge capabilities outside of their repository.
Semantic Merge can be run against a repository of code and can determine how most merges should take place. That’s a tall order for many developers who, thanks to an increasingly popular distributed development model, are often editing the same code at multiple places on the planet at once.
Pablo Santos, cofounder of Codice, said that beta access to Semantic Merge has already been offered to C# and Visual Basic developers. Today, the Semantic Merge beta expanded to include Java.
“Whenever you merge code, you need three files: You need my changed file, your changed file, and the file the way it was before the changes,” said Santos. “The first thing Semantic Merge is going to do is use parsing technology to figure out what has changed. Instead of going line for line, it will merge the different structures. If I have a method called ‘foo’ and you just moved it from the beginning of the class to the end of the class, Semantic Merge is not confused by that. It recognizes that it’s the same method, it’s just moved.”

Semantic Merge
Semantic Merge is also able to adaptively learn about the code it is merging, something that allows it to handle about 90% of all merges in most cases, said Santos.
“It’s a beautiful tool because it boosts productivity,” he said. “We replay the merges in order to test, and we found that 97% of Semantic Merges were able to merge the code, so developers need to review 97% less code when merging.”
The goal for the future is to expand merge capabilities to the point where whole pieces of code can be moved into different files without confounding the Semantic Merge, said Santos. At present, it is restricted to merging changes within the same file, but Santos claims that this capability should help enterprises shrug off the instinctual fear of merging code.
“We are working to match more changes; the next big challenge for us is to actually implement move-tracking across files,” said Santos. “That’s simply completely out of the scope for right now, but that’s the next frontier.”