Skip format conflicts with the new SemanticMerge 1.0.64

Friday, May 16, 2014 19 Comments

We switched to the latest open-source Roslyn in the previous release and now we’re adding more features based on that.

This new release includes 2 major features:

  1. Automatic method body merge resolution with the --merge-decl param: so far if a method (or any declaration body) was modified by the two contributors, the user had to manually launch the external 3-way merge tool to solve the conflicts, even when the merge was automatic. Now the new param forces Semantic to try to solve every method body so now the merge is as automatic as possible.
  2. Skip code formatting conflicts: suppose two developer reformat the same method but only one of them introduces an actual change. It can be time consuming to figure out that the change was only a reformat and that nothing really changes before accepting the real change. This is exactly what the new feature does for C#. It solves 3 User Voice requests:
Remark: If you want the advanced feature related to the ignored format available for .net languages, you should download the Microsoft Build Tools 2013:

Automatic resolution of conflicts inside methods*

(*Methods or any other declaration body).

Consider the following scenario:


Where the method “CheckParentsFromDstMergeLink()” was:

  • moved to a different location by the first developer and also modified (that’s why the icon is ‘c’ and ‘m’ (changed and moved)).
  • changed by the second developer.

And the changes were as follows:

Since the changes were made on non-colliding lines, the merge can be fully automatic.

Adding the new param --merge-decl (which stands for merge declarations) Semantic will still show up showing the method conflict as solved:

If you also add -a (which stands for ‘automatic’) the GUI won’t be launched and the result file will be directly created (for files with conflicts that can be automatically solved).

Skip code formatting conflicts

This is the most important feature we have introduced in the last months: it really takes advantage of ‘understanding’ the underlying code structure to automatically solve as many conflicts as possible.

Suppose you’ve a method like this one:


Then one of the developers starts working and moves the method to a different location within the class (like in the previous example). But he also makes some changes to the code:

Meanwhile a second developer makes some changes to the same method too:

As you can see they both made a non-colliding change which is adding more log on different locations, but then there’s a colliding change: the two modified the method declaration: one added a new param while the other reformatted it. While easy to handle for a human, every 3-way merge tool will end up with a conflict because it can’t decide what to do:

But Semantic, with the --merge-decl argument is able to automatically solve the conflict as follows:

Semantic basically knows the ‘reformat’ change can be discarded and then re-runs the text merge.

Next steps – improving ‘ignore reformat heuristics’

Well, ignoring format changes during merge (or diff) can greatly help saving precious time without being distracted by trivial changes.

That being said, code formatting is crucial for readability, so there will be many situations where you’ll want to preserve the formatting.

In the case above Semantic made a decision: since undoing a format change avoids a time consuming (ok, not so time consuming this time, but you get the point) conflict resolution, Semantic will just undo the change to simplify the merge.

Our goal is to make Semantic smart enough to avoid only the minimum number of reformats, so that the code preserves the preferences of the author.

While it is still definitely work in progress, we’re happy to say that Semantic is able to do things beyond what any other diff or merge tool can!


The SemanticMerge team

We develop Plastic SCM, a version control that excels in branching and merging, can deal with huge projects and big binary assets natively, and it comes with GUIs and tools to make everything simpler.

If you want to give it a try, download it from here.

We are also the developers of SemanticMerge, and the gmaster Git client.


Maria Lena said...

Git combine clashes are typically set off by changes to a similar book block in a document. Where the framework completing the union treats each record as a lot of self-assertive squares of text, it will experience issues in deciding when the progressions inside a document can be securely consolidated, and when human intercession is required. cheap essay writing UK

Atheef said...

Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!

Unknown said...

I uninstalled Vegas utilizing CCleaner Utility and re-introduced with the refreshed form manufacture 10e 738. In the wake of dispatching Vegas, I had the option to get my Capture Software to catch from Camcorder, did an import to timetable and playback was fine. I was even ready to import a formerly caught videofile and it too played back alright.
British Dissertation Help

Lorriel Sims said...

Mastery can only be attained through the development of a comprehensive knowledge or skill. It is the highest order of accomplishment in our craft Check us out

unknown said...

I always like to read a quality content having accurate information regarding the subject and the same thing I found in this post.

Website Development Company |

unknown said...

Great information, i was searching of this kind of information, thank you very much for sharing with us.

Craigslist Posting Service for Car Dealers |

unknown said...

This is really amazing website that I have been found on google regarding website Blog Commenting sites. and I would like to thank admin who also given us to post the link on his side.

Lubbock moving company |

unknown said...

This was something I was looking for, really helpful, and great work is done. Thank you so much for sharing such valuable information.

Car Auction Software |

unknown said...

It’s really a cool and helpful piece of information. I am glad that you shared useful information with us. Please keep us up to date like this. Thanks for sharing.

Best CRM for Small Businesses |

unknown said...

I am really like it very much for the interesting info in this blog that to this website is providing the wonderful info in this blog that to utilize the great technology in this blog.

Web Development Company in Gwalior |

unknown said...

Thank you very much for writing this blog. It was very easy to understand.

Marriage Garden in Gwalior |

apkreach said...

Nice info.....

Visit: brawl stars mod menu apk

Dakota Leest said...

My favorite shoes are sneakers. I cannot stand a month to buy a pair of new sneakers. They are the most comfortable and casual. I work in the office and I often go on foot. The shoes must be comfortable.

Ahad Ansari said...

Find wedding planner services from one of the best event planners in Maryland, the United States.

I'm truly similar to it particularly for the intriguing information with regards to this blog that to this site is giving the superb data in this blog that to use the incredible innovation in this blog. Someone Do My Dissertation For Me UK

Unknown said...

Both Visual Studio and Margit have conflict resolution tools built-in. Essay Help UK

For Sexy and hot girls entertaining services
Dubai Escorts
call girls in Dubai

Superessays said...

It is a perfect post to familiarize yourself with SemanticMerge 1.0.64. I have been writing a critical analysis essay topics for this theme and some facts I wrote were also mentioned in your article.

Unknown said...

I like to visit interesting blogs and find new information. I often use this information for my university studies. I started using
article rewriting service. It's great. I am very glad to have the opportunity to tell you about this.