In collaborative software development, program merging is {\it the} mechanism to integrate changes from multiple programmers. %in modern version control systems. Merge algorithms in modern version control systems report a conflict when changes interfere textually. Merge conflicts require manual intervention and frequently stall modern continuous integration pipelines. Prior work found that, although costly, a large majority of resolutions involve re-arranging text without writing any new code. Inspired by this observation we propose the {\it first data-driven approach} to resolve merge conflicts with a machine learning model. We realize our approach in a tool \deepMergeTool{} that uses a novel combination of (i) an edit-aware embedding of merge inputs and (ii) a variation of pointer networks, to construct resolutions from input segments. We also propose an algorithm to localize manual resolutions in a resolved file and employ it to curate a ground-truth dataset comprising 8,719 non-trivial resolutions in JavaScript programs. Our evaluation shows that, on a held out test set, \deepMergeTool{} can predict correct resolutions for 37\% of non-trivial merges, compared to only 4\% by a state-of-the-art semistructured merge technique. Furthermore, on the subset of merges with upto 3 lines (comprising 24\% of the total dataset), \deepMergeTool{} can predict correct resolutions with 78\% accuracy.
翻译:在合作软件开发中,程序合并是整合多个程序员变化的机制 。% 现代版本控制系统 。 现代版本控制系统中的合并算法在修改干扰文本时报告冲突。 合并冲突需要人工干预, 并经常拖延现代连续整合管道。 先前的工作发现,尽管费用高昂, 大部分决议涉及重新排列文本, 而没有写入任何新代码 。 受此观察的启发, 我们提议了 首次数据驱动的方法, 以解决与机器学习模式的合并冲突 。 我们在一个工具\ deep MegeTool\ 中实现了我们的方法, 该工具使用新颖的组合 (一) 合并输入的编辑- 认知嵌入和 (二) 指向网络的变换, 以构建输入部分的决议 。 我们还提议了一个将手册决议本地化的算法, 并用它来调节由8, 719 非三重分辨率组成的 JavaScript 程序 。 我们的评估显示, 在一次测试中,\ deepMegeTool_ 和 revy- mix comstalstal commission subilate laction rouptiquest rouptiquest 这样的第 4 rotiquest rotical roxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx