MergeBot: A platform of semi-structured merge conflict resolution for C/C++ code

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...

Full description

Saved in:
Bibliographic Details
Main Authors: Hua He, Xiaofan Liu, Lei Xu, Guanghui Mei, Jifeng Xuan
Format: Article
Language:English
Published: Elsevier 2025-05-01
Series:SoftwareX
Subjects:
Online Access:http://www.sciencedirect.com/science/article/pii/S2352711025001116
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary: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.
ISSN:2352-7110