MergeBot: A platform of semi-structured merge conflict resolution for C/C++ code
Hua He, Xiaofan Liu, Lei Xu, Guanghui Mei, Jifeng Xuan · SoftwareX · 2025
In software version control systems, like Git, merge conflicts typically arise when multiple developers edit the same segment of a source file from different branches. Detecting merge conflicts can be automated; however, resolving merge conflicts is tedious and demanding. Developers have to manually read and trace the conflicts to reconcile the changes. In this paper, we introduce MergeBot, a platform designed for resolving merge conflicts in C/C++ codebases. MergeBot utilizes the techniques of static program analysis to recommend the resolution of merge conflicts via a user-friendly graphical user interface. In the resolution of merge conflicts, MergeBot can help reduce introducing potential errors via real-time visualization of code differences between pre-resolution and post-resolution versions; meanwhile, MergeBot can avoid error propagation via the prevention of staging or committing unresolved conflicts. We demonstrate the extensibility of semi-structured merge through an implementation in C/C++. The semi-structured merge combines structural merge of program entities (e.g., functions, classes) with unstructured merge of code lines. A preliminary evaluation on 10 widely-used open-source C/C++ projects demonstrates the effectiveness of MergeBot with the precision of 62.9% and the accuracy of 42.4% in resolving merge conflicts.