LastMerge: A language-agnostic structured tool for code integration

๐Ÿ“… 2025-07-25
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
Current line-based code merging tools suffer from low accuracy, while AST-based structured merging tools achieve higher precision but face limited generalizability due to strong language coupling and high development overhead. This paper introduces LastMergeโ€”the first language-agnostic, highly configurable framework for generic structured merging. It decouples the core merging logic from language-specific implementations via a lightweight AST interface adaptation layer, eliminating the need to reimplement the merging engine for each language. Empirically evaluated on Java, LastMerge reduces false positives by 15% compared to jDime and decreases real conflict omission rate by 42% relative to Mergiraf (vs. Spork), while matching the runtime performance of state-of-the-art language-specialized tools. This work substantially lowers the engineering barrier for structured merging and advances its practical adoption in industry.

Technology Category

Application Category

๐Ÿ“ Abstract
Unstructured line-based merge tools are widely used in practice. Structured AST-based merge tools show significantly improved merge accuracy, but are rarely used in practice because they are language specific and costly, consequently not being available for many programming languages. To improve merge accuracy for a wide range of languages, we propose LastMerge, a generic structured merge tool that can be configured through a thin interface that significantly reduces the effort of supporting structured merge. To understand the impact that generic structured merge might have on merge accuracy and performance, we run an experiment with four structured merge tools: two Java specific tools, jDime and Spork, and their generic counterparts, respectively LastMerge and Mergiraf. Using each tool, we replay merge scenarios from a significant dataset, and collect data on runtime, behavioral divergences, and merge accuracy. Our results show no evidence that generic structured merge significantly impacts merge accuracy. Although we observe a difference rate of approximately 10% between the Java specific tools and their generic counterparts, most of the differences stem from implementation details and could be avoided. We find that LastMerge reports 15% fewer false positives than jDime while Mergiraf misses 42% fewer false negatives than Spork. Both generic tools exhibit comparable runtime performance to the state of the art language specific implementations. These results suggest that generic structured merge tools can effectively replace language-specific ones, paving the way for broader adoption of structured merge in industry.
Problem

Research questions and friction points this paper is trying to address.

Unstructured merge tools lack accuracy but are widely used
Language-specific structured merge tools are costly and unavailable for many languages
Generic structured merge tools can match accuracy of language-specific ones
Innovation

Methods, ideas, or system contributions that make the work stand out.

Generic structured merge tool configurable via thin interface
Reduces effort for supporting structured merge across languages
Comparable runtime performance to language-specific tools
๐Ÿ”Ž Similar Papers
No similar papers found.