Keeping code quality high requires constant refactors. Semantic Version Control helps you diffing refactored code.
Check the next diff: one method was moved to a new class and changed at the same time. Plastic detects
that and shows the diffs semantically. Note how the deleted Usings
are also correctly identified:
Check the second example. This is a crisscross diff that happens when two methods swap their relative positions on the file. Plastic parses the code, finds where the methods are, and then diffs them. A traditional text-based diff tries to match line-by-line, which doesn't work here.
The integrated semantic diff also adds an outline on the left to quickly navigate and highlight changes:
Plastic also includes a visual diff to understand the refactors at a higher level:
Learn more about what our semantic technology and the Plastic merge engine can do:
Combining semantic and Plastic to solve really complex merges
Refactor Analysis adds multi-file semantic diff capabilities — cross-file refactor detection.
What if you decide to split a class in two (or more) and move one of them to another file(s)? The Analyze refactors in Plastic SCM can easily track it.
Take a careful look at the example below: the old Socket
class was split in two and the Listen()
method was moved to the new ServerSocket.cs file. And Plastic can track it and show you how it was changed!
The Refactor Group element in the tree basically says that it has detected a group of files that have been modified together:
Refactoring is key to keep code quality high and now diffing the refactored code will be straightforward.
As you can see, Refactor Analysis or multi-file semantic diff is a huge step ahead in what the version control can do and how it can help you being more productive on a daily basis. We think that what you see here today will be the standard in a few years.
Check the next screenshot to see how the regular file diff is decorated with new icons (the Multi-file Moved category) to explain that a "cross-file diff" has been detected:
In the following picture, you can see one more example of a multi-file refactor where a class is split in three:
The Moved icon lets you: Diff moved code... to show up a diff taking the code from the two involved files and letting you diff the method; and Go to moved code to jump to a different file:
Learn more about the cross-file refactor detection:
Semantic Method History - ever wanted to see the history of a method? Yes, a method, not a file. Even if the method was renamed or moved inside the file...
Find more about Semantic Method History in the following blogpost: