Towards Merge Conflict Resolution by Combining Existing Lines of Code

  • Heleno de S. Campos Junior UFF
  • Gleiph Ghiotto L. de Menezes UFSJ
  • Márcio de Oliveira Barros UNIRIO
  • André van der Hoek University of California
  • Leonardo Gresta Paulino Murta UFF


Software developers often need to combine their contributions. This operation is called merge. When the contributions happen at the same physical region in the source code, the merge is marked as conflicting and must be manually resolved by the developers. Existing studies explore why conflicts happen, their characteristics, and how they are resolved. In this paper, we investigate a specific subset of merge conflicts, which may be resolved using a combination of existing lines. We analyze 10,177 conflict chunks of popular projects that were resolved by combining existing lines, aiming at characterizing and finding patterns that developers frequently use to resolve them. We found that these conflicting chunks and their resolutions are usually small (they have a median of 6 LOC and 3 LOC, respectively). Moreover, 98.6% of the analyzed resolutions preserve the order of the lines in the conflicting chunks. We also found that 77.4% of the chunk resolutions do not interleave lines from different contributions more than once. These findings altogether, when used as heuristics for automatic merge resolution, could enable the reduction of the search space by 94.7%, paving the road for future search-based software engineering tools for this problem.
Palavras-chave: Version control systems, search-based software engineering, software merge, conflict resolution
Como Citar

Selecione um Formato
CAMPOS JUNIOR, Heleno de S.; MENEZES, Gleiph Ghiotto L. de; BARROS, Márcio de Oliveira; HOEK, André van der; MURTA, Leonardo Gresta Paulino. Towards Merge Conflict Resolution by Combining Existing Lines of Code. In: SIMPÓSIO BRASILEIRO DE ENGENHARIA DE SOFTWARE (SBES), 36. , 2022, Uberlândia. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2022 . p. 425–434.