The highly parallel workflows of modern software development have made merging of source code a common activity for developers. The state of the practice is based on line-based merge, which is ubiquitously used with "git merge". Line-based merge is however a generalized technique for any text that cannot leverage the structured nature of source code, making merge conflicts a common occurrence. As a remedy, research has proposed structured merge tools, which typically operate on abstract syntax trees instead of raw text. Structured merging greatly reduces the prevalence of merge conflicts but suffers from important limitations, the main ones being a tendency to alter the formatting of the merged code and being prone to excessive running times. In this paper, we present SPORK, a novel structured merge tool for JAVA. SPORK is unique as it preserves formatting to a significantly greater degree than comparable state-of-the-art tools. SPORK is also overall faster than the state of the art, in particular significantly reducing worst-case running times in practice. We demonstrate these properties by replaying 1740 real-world file merges collected from 119 open-source projects, and further demonstrate several key differences between SPORK and the state of the art with in-depth case studies.
翻译:现代软件开发的高度平行工作流程使源代码的合并成为开发者的常见活动。 做法的状态是以线基合并为基础, 并普遍使用“ 基合并 ” 。 但是, 线基合并对于任何不能利用源代码结构化性质、 使合并冲突成为常见现象的文本来说是一种通用技术。 作为补救措施, 研究提出了结构化合并工具, 通常在抽象的语法树上运作, 而不是原始文本上运作。 结构化合并极大地减少了合并冲突的普遍程度, 但却受到重要的限制, 主要的限制是倾向于改变合并代码的格式, 并且容易发生过度运行的时间。 在本文中, 我们介绍SPORK, 这是JAVA的新型结构化合并工具。 SPORK是独一无二的, 因为它保持格式化, 其程度大大高于可比的先进工具。 SPORK 总体来说也快于艺术现状, 特别是大大减少了实践中最坏的运行时间。 我们通过重看从119个开放源项目中收集的1 740 740 个真实世界文档的合并, 进一步展示了与科学案例研究之间的一些关键差异。