Semistructured Merge with Language-Specific Syntactic Separators
Guilherme Cavalcanti, Paulo Borba, Leonardo dos Anjos, Jônatas Clementino
Abstract
Structured merge tools exploit programming language syntactic structure to enhance merge accuracy by reducing spurious conflicts reported by unstructured tools. By creating and handling full ASTs, structured tools are language-specific and harder to implement. They can also be computationally expensive when merging large files. To reduce these drawbacks, semistructured merge tools work with partial ASTs that use strings to represent lower level syntactic structures such as method bodies, and rely on unstructured tools to merge them. This, however, results in merge accuracy loss. To improve accuracy without compromising semistructured merge benefits, we propose a tool that leverages language-specific syntactic separators to infer structure without parsing. We still resort to an unstructured tool to merge lower level structures, but only after preprocessing the code so that text in between separators such as curly braces appear in separate lines. This way we emulate the capabilities of structured merge tools while avoiding their drawbacks. By comparing our tool with a robust implementation of semistructured merge, we find that our tool substantially reduces the number of spurious conflicts. We also observe significant but less substantial reductions on the overall number of reported conflicts, and of files with conflicts. However, similar to structured tools, our tool lets more merge conflicts go undetected. Our tool shows significant improvements over unstructured tools widely used in practice. Finally we observe that exploiting language-specific syntactic separators introduces unique textual alignment challenges. CCS CONCEPTS • Software and its engineering → Software maintenance tools; Software configuration management and version control systems.
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 cea554f0-f2f4-433d-9468-327567ddd2abBuilds on2
- 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
- Detecting Build Conflicts in Software Merge for Java Programs via Static AnalysisSheikh Shadab Towqir, Bowen Shen, Muhammad Ali Gulzar, Na MengASE 2022 · 7 citations
Related papers
- On the Correctness of Software MergeAkira Mori, Masatomo HashimotoASE 2025
- Evaluation of Version Control Merge ToolsBenedikt Schesch, Ryan Featherman, Kenneth J. Yang, Ben R. Roberts et al.ASE 2024 · 1 citation
- Syntactic Code Search with Sequence-to-Tree Matching: Supporting Syntactic Search with Incomplete Code FragmentsGabriel Matute, Wode Ni, Titus Barik, Alvin Cheung et al.PLDI 2024 · 1 citation
- 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
- Merge Conflict Resolution: Classification or Generation?Jinhao Dong, Qihao Zhu, Zeyu Sun, Yiling Lou et al.ASE 2023 · 8 citations
