On the Methodology of Three-Way Structured Merge in Version Control Systems: Top-down, Bottom-Up, or Both

Fengmin Zhu,Xingyu Xie,Dongyu Feng,Na Meng,Fei He
DOI: https://doi.org/10.1016/j.sysarc.2023.103011
IF: 5.836
2023-01-01
Journal of Systems Architecture
Abstract:Three-way merging is an essential component of version control systems. Despite the efficiency of the conventional line-based textual methods, syntax-based structured approaches have demonstrated benefits in improving merge accuracy. Prior structured merging approaches visit abstract syntax trees in a top-down manner, which struggles to identify and merge shifted code generally. This work introduces a novel methodology combining a top-down and a bottom-up visit of abstract syntax trees, which manipulates shifted code effectively and elegantly. Especially, we reduce the merge problem of ordered lists to computing a topological sort of strongly connected components of the constraint graph. Compared with four representative merge tools in 40,533 real-world merge scenarios, our approach achieves the highest merge accuracy while being 2.5x as fast as a state-of-the-art structured merge tool.
What problem does this paper attempt to address?