Semistructured Merge: Rethinking Merge in Revision Control Systems

kaestner@cs.cmu.edu (S. Apel, J. Liebig, B. Brandl, C. Lengauer, C. Kästner)
Sat, 05 Mar 2016 18:41:39 -0500

Sven Apel, Jörg Liebig, Benjamin Brandl, Christian Lengauer, and Christian Kästner. Semistructured Merge: Rethinking Merge in Revision Control Systems. In Proceedings of the European Software Engineering Conference and ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE), pages 190--200, New York, NY: ACM Press, September 2011.

An ongoing problem in revision control systems is how to resolve conflicts in a merge of independently developed revisions. Unstructured revision control systems are purely text-based and solve conflicts based on textual similarity. Structured revision control systems are tailored to specific languages and use language-specific knowledge for conflict resolution. We propose semistructured revision control systems that inherit the strengths of both classes of systems: generality and expressiveness. The idea is to provide structural information of the underlying software artifacts—declaratively, in the form of annotated grammars. This way, a wide variety of languages can be supported and the information provided can assist the automatic resolution of two classes of conflicts: ordering conflicts and semantic conflicts. The former can be resolved independently of the language and the latter can be resolved using specific conflict handlers supplied by the user. We have been developing a tool that supports semistructured merge and conducted an empirical study on 24 software projects developed in Java, C#, and Python comprising 180 merge scenarios. We found that semistructured merge reduces the number of conflicts in 60 % of the sample merge scenarios by, on average, 34 %. Our study reveals that renaming is challenging in that it can significantly increase the number of conflicts during semistructured merge, which we discuss.