Merge Conflict Resolution: Classification or Generation?
Jinhao Dong, Qihao Zhu, Zeyu Sun, Yiling Lou, Dan Hao
Abstract
Collaborative development is critical to improve the productivity. Multiple contributors work simultaneously on the same project and might make changes to the same code locations. This can cause conflicts and require manual intervention from developers to resolve them. To alleviate the human efforts of manual conflict resolution, researchers have proposed various automatic techniques. More recently, deep learning models have been adopted to solve this problem and achieved state-of-the-art performance. However, these techniques leverage classification to combine the existing elements of input. The classification- based models cannot generate new tokens or produce flexible combinations, and have a wrong hypothesis that fine-grained conflicts of one single coarse-grained conflict are independent. In this work, we propose to generate the resolutions of merge conflicts from a totally new perspective, that is, generation, and we present a conflict resolution technique, MergeGen. First, we design a structural and fine-grained conflict-aware representation for the merge conflicts. Then, we propose to leverage an encoder- decoder-based generative model to process the designed conflict representation and generate the resolutions auto-regressively. We further perform a comprehensive study to evaluate the effectiveness of MergeGen. The quantitative results show that MergeGen outperforms the state-of-the-art (SOTA) techniques from both precision and accuracy. Our evaluation on multiple programming languages verifies the good generalization ability of MergeGen. In addition, the ablation study shows that the major component of our technique makes a positive contribution to the performance of MergeGen, and the granularity analysis reveals the high tolerance of MergeGen to coarse-grained conflicts. Moreover, the analysis on generating new tokens further proves the advance of generative models.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext cd7d19c2-b287-4e06-a263-4104e128e403Cited by top-tier papers2
- Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial TrainingYangsen Wang, Yizhou Chen, Yifan Zhao, Zhihao Gong et al.ASE 2024 · 3 citations
- CodeMapper: A Language-Agnostic Approach to Mapping Code Regions Across CommitsHuimin Hu, Michael PradelICSE 2026
Builds on4
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 citations
- TreeGen: A Tree-Based Transformer Architecture for Code GenerationZeyu Sun, Qihao Zhu, Yingfei Xiong, Yican Sun et al.AAAI 2020 · 196 citations
- FIRA: Fine-Grained Graph-Based Code Change Representation for Automated Commit Message GenerationJinhao Dong, Yiling Lou, Qihao Zhu, Zeyu Sun et al.ICSE 2022 · 50 citations
- Program merge conflict resolution via neural transformersAlexey Svyatkovskiy, Sarah Fakhoury, Negar Ghorbani, Todd Mytkowicz et al.FSE 2022 · 33 citations
Related papers
- EditFusion: Resolving Code Merge Conflicts via Edit SelectionChangxin Wang, Lei Xu, Rundong Wang, Yiming Ma et al.ASE 2025
- Planning for untangling: predicting the difficulty of merge conflictsCaius Brindescu, Iftekhar Ahmed, Rafael Leano, Anita SarmaICSE 2020 · 19 citations
- Revisiting the Conflict-Resolving Problem from a Semantic PerspectiveJinhao Dong, Jun Sun, Yun Lin, Yedi Zhang et al.ASE 2024
- Can Program Synthesis be Used to Learn Merge Conflict Resolutions? An Empirical AnalysisRangeet Pan, Vu Le, Nachiappan Nagappan, Sumit Gulwani et al.ICSE 2021 · 19 citations
- Using pre-trained language models to resolve textual and semantic merge conflicts (experience paper)Jialu Zhang, Todd Mytkowicz, Mike Kaufman, Ruzica Piskac et al.ISSTA 2022 · 30 citations
