Caius Brindescu, Iftekhar Ahmed, Carlos Jensen, Anita Sarma
Merge conflicts are known to cause extra effort for developers, but little is known about the effect on the software. While some research has been done, many questions remain. To better understand merge conflicts and their impact we conducted an empirical study of the causes, frequency, and impact of merge conflicts, where impact is measured in terms of bug fixing commits associated with conflicts. We analyzed 143 open source projects and found that for 75.23% of conflicts, a developer needs to reflect on the program logic to resolve conflicts, and that almost 1 in 5 merges cause conflicts. We also found code associated with a merge conflict to be twice as likely to have a bug, and code associated with semantic merge conflicts 26x more likely to have a bug.
We manually classified 600 randomly sampled commmits. We then trained a classifier to classify our corpus of 6,979 conflicting commits. The categories are presented in the table below:
Category | Definition | Complexity | Example |
Semantic | Conflicts involving two conflicting semantic changes | Non-trivial | |
Disjoint | Unrelated semantic changes overlapping in lines | Non-trivial | |
Delete | A change and a delete | Non-trivial | |
Formatting | Conflicting changes in formatting | Trivial | |
Comments | Conflicting changes in comments | Trivial | |
Other | Conflicts that do not belong to any of the above | Trivial |
This sections details the features that were used to classify commits based on their root cause (Section 3.2.1 in the paper.)
Feature | Details |
AST_A_SIZE | The total number of AST Nodes of the files involved in a conflict, in one branch |
LOC_A_SIZE | The sum of LOC of the files involved in a conflict, in one branch |
AST_B_SIZE | The total number of AST Nodes of the files involved in a conflict, in the other branch |
LOC_B_SIZE | The sum of LOC of the files involved in a conflict, in the other branch |
CONFLICTING_AST_A_TO_B | The difference between the two branches, considering only the conflicting region, in AST nodes |
CONFLICTING_AST_A_TO_SOLVED | The difference between one of the branches and the solved version, in AST nodes |
CONFLICTING_AST_B_TO_SOLVED | The difference between the other branch and the solved version, in AST nodes |
CONFLICTING_LOC_A_TO_B | The number of lines difference between the two branches, considering only the conflicting region, in LOC |
CONFLICTING_LOC_A_TO_SOLVED | The number of lines difference between one of the branches and the solved version considering only the conflicting region, in LOC |
CONFLICTING_LOC_B_TO_SOLVED | The number of lines difference between the other branch and the solved version, in LOC |
LOC_SIZE_SOLVED | The size of the resolved merge conflict |
AST_A_TO_B | The number of lines difference between the two branches, in AST nodes |
NO_AUTHORS | The number of authors involved in that particular merge |
LOC_DIFF | The difference between the two branches, in LOC, before the merge |
AST_DIFF | The difference between the two branches, in AST nodes, before the merge |
MERGED_IN_MASTER | True if the branch was merged into master |
TIME_SOLVED | The time of the resolution |
TIME_A | The timestamp of the last commit on one of the branches |
TIME_B | The timestamp of the last commit on the other branch |
NO_STATEMENTS | The number of statements involved in a conflict |
NO_METHODS | The number of methods involved in a conflict |
NO_CLASSES | The number of classes involved in a conflict |
DIFF_NODES_A_TO_B | A set of node types involved in a conflict |
IS_AST_CONFLICT | True, if the conflict happens at the AST level (concurrent modifications to the same AST node) |
The figure below shows the confusion matrix for our classifier.
The table below shows the corpus we used for our paper.
Project | Last commit | Clone URL |
ActionBarSherlock | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock.git |
Activiti | 72981d6070b409ab5184a9401fb9f7851a659ef2 | https://github.com/Activiti/Activiti.git |
aipo | 0a9e9491e2146043601b7462b8dac81471f1db53 | https://github.com/aipocom/aipo.git |
androidannotations | 7b7a55ebacb58e26988a2f8f8adf0eb6e0b56d2f | https://github.com/excilys/androidannotations.git |
android-bootstrap | 2905ac2a2f4bae2e9684b798e2ade14c5afd9d34 | https://github.com/donnfelker/android-bootstrap.git |
android-flip | ab2dea1b045ffc626221c2826ce9dd00823e696d | https://github.com/openaphid/android-flip.git |
android-viewflow | 3da74fa32a935bcbb37e5ebeb270477cde1985d4 | https://github.com/pakerfeldt/android-viewflow.git |
antlr4 | 59676745319b864fe3b8fd61710e730e760f5afd | https://github.com/antlr/antlr4.git |
astrid | 4fc5c7714fb1b48ae46dcacbda287bcef9c3f6bf | https://github.com/todoroo/astrid.git |
atlas-feeds | 602a1df271fb2873c11aff26506429ede5613b82 | https://github.com/atlasapi/atlas-feeds.git |
atlas-model | 7307e326838addaff161b3be836d65c2892b6a74 | https://github.com/atlasapi/atlas-model.git |
atlas-persistence | 95c437d36ed9555a6afe95442fd04b36cacca664 | https://github.com/atlasapi/atlas-persistence.git |
autopsy | 5cd50e9aec71479803e5ee149d5dac5bbd7c7ed5 | https://github.com/sleuthkit/autopsy.git |
BallCraft | 4bf32ffa4f80f669c8300c7d28cc22dae7f34445 | https://github.com/COMP3111H-Project-Team/BallCraft.git |
beam | ce738053d525f8ce729a9455267f89381a685446 | https://github.com/bcdev/beam.git |
bioformats | 4d0f6757bed4e9b219ee9bfac575f1e924d9a2b9 | https://github.com/openmicroscopy/bioformats.git |
blueprints | 70b35dc90a11602b03afe8e0862f8a0836b34c13 | https://github.com/tinkerpop/blueprints.git |
Bukkit | f210234e59275330f83b994e199c76f6abd41ee7 | https://github.com/Bukkit/Bukkit.git |
bundlemaker | f8d12fbc5927268b7fb817a5bf970a1f2ef2c0e3 | https://github.com/wuetherich/bundlemaker.git |
butterknife | 6ab6fb5e98a9da8eeaecc4f8917f06adbc8b67a7 | https://github.com/JakeWharton/butterknife.git |
candlepin | 1f073f1092225b8472323d351e123d4235785d30 | https://github.com/candlepin/candlepin.git |
capedwarf-blue | 6aca5dd1eb9eb31a9c70c73bdcbed608b2c49022 | https://github.com/capedwarf/capedwarf-blue.git |
cat | 99ffe1660bb08e04c4c20f0f77a39f9686149622 | https://github.com/dianping/cat.git |
cloudname | 61fd8d5790d9be894a87b463fad4e69cd94f76e0 | https://github.com/Cloudname/cloudname.git |
cms-ce | a779b00f26685175aaedb4cd4ea5a561e4f9198e | https://github.com/enonic/cms-ce.git |
commafeed | 6a699ed5f16fa22852cdb16cb49a908d3473c1df | https://github.com/Athou/commafeed.git |
commandhelper | b8dcdb78b67896f234d698072e829287dbed9c7d | https://github.com/sk89q/commandhelper.git |
CONNECT | 80cf7475c697414ce3e42e39014c85d52abbdd84 | https://github.com/CONNECT-Solution/CONNECT.git |
core | aef5f83225b5c2a255c4a01f385a4795ce853d17 | https://github.com/forge/core.git |
cse403 | 24e2467c91b75d3384fffae14d91e17e3c001a65 | https://github.com/coldstar96/cse403.git |
cucumber-jvm | 0aecc4d3e4c15fc34b63f848043deba2c230e35f | https://github.com/cucumber/cucumber-jvm.git |
droidplanner | dcf1988852fdf144927ce53453888ce4c350d78c | https://github.com/arthurbenemann/droidplanner.git |
DSpace | 61ac9371b2714f57f4c96470b077eb37ed6b8c9c | https://github.com/DSpace/DSpace.git |
dynmap | 20320c578f89d0d8e41ff992afbf2f60dff3bb65 | https://github.com/webbukkit/dynmap.git |
ecms | c4479a220d78f2f1ec09888cd770d3fd1cd512ef | https://github.com/exoplatform/ecms.git |
elasticsearch | 3bd33f839fd293611810ee8d79be4358213dbc52 | https://github.com/elasticsearch/elasticsearch.git |
elephant-bird | 61f3a8f1ba939b4fe1d43d76be181af7b5e55c51 | https://github.com/kevinweil/elephant-bird.git |
ENdoSnipe | 129b66087cd31cb1548b842b897febc3dfb405dc | https://github.com/endosnipe/ENdoSnipe.git |
fitnesse | 893ce6be6606bbe2312a4716008280baec3fd989 | https://github.com/unclebob/fitnesse.git |
flowvisor | 30fbc0628b4bb3ccba187a8ce4dedeb23f35a670 | https://github.com/OPENNETWORKINGLAB/flowvisor.git |
FML | 1d627656b890ee9ae530687c16a2c288570b4386 | https://github.com/MinecraftForge/FML.git |
furry-octo-avenger | 37da50bacb62469be3f4423817c0a03f554509d7 | https://github.com/iuval/furry-octo-avenger.git |
GeoGit | e92012ff85bc8f6dc99350ad1e774b82f9f95e42 | https://github.com/opengeo/GeoGit.git |
geoserver | 89d535a96ac16d220e7d2600fd384f04afada7bc | https://github.com/geoserver/geoserver.git |
gerrit-trigger-plugin | 3e31f724712d5a6f43605f18f601ca0d18d63423 | https://github.com/jenkinsci/gerrit-trigger-plugin.git |
ggc-connect | 1aac49202e35f4fd1565aefa0f7d9a80c3b0e172 | https://github.com/ggc-itec/ggc-connect.git |
gitblit | 252dc07d7f85cc344b5919bb7c6166ef84b2102e | https://github.com/gitblit/gitblit.git |
glide | df0856b32383237fdbb672849a20dee9c73c2193 | https://github.com/bumptech/glide.git |
graylog2-server | d47836bc8fad6422d9334820137cfb4e8b76b413 | https://github.com/Graylog2/graylog2-server.git |
groovy-core | 01309f9d4be34ddf93c4a9943b5a97843bff6181 | https://github.com/groovy/groovy-core.git |
gwt-bootstrap | 3d595bdfabc52c4f682fac5e27bfad7f694c15ae | https://github.com/gwtbootstrap/gwt-bootstrap.git |
gxa | c507f08f46545be97e9b90bc00123600a67f23a1 | https://github.com/gxa/gxa.git |
hank | be0f1b83a038ac167f3c574a1b4c2ddf8a69db98 | git://github.com/LiveRamp/hank |
hazelcast | 3b4c1c5c2b7c1bc27a37d59cf7597e711f9b8487 | https://github.com/hazelcast/hazelcast.git |
head | 88e7df964688ca3955b38125213090297d4171a4 | https://github.com/mifos/head.git |
hector | a302e68ca8d91b45d332e8c9afd7d98030b54de1 | https://github.com/hector-client/hector.git |
hit | 9caac9c7288627ae384e8fb2c347ff847ce3017c | https://github.com/CS340Group/hit.git |
HoloEverywhere | b870abb5ab009a5a6dbab3fb855ec2854e35e125 | https://github.com/Prototik/HoloEverywhere.git |
hornetq | fdc19ebf7e456571860ec229a504bf73a2b4cb8d | https://github.com/hornetq/hornetq.git |
Hydra | 2c9039f25e41ee872c30add7021361d77d6330de | https://github.com/Findwise/Hydra.git |
jackson-dataformat-protobuf | 1b7fe15db7e13d72235c326bce65468bb75c0e90 | git://github.com/FasterXML/jackson-dataformat-protobuf |
jackson-datatype-joda | 373b2b76b5ffd10fad6eb78f14e6401badd1814c | git://github.com/FasterXML/jackson-datatype-joda |
jade4j | a95bac357b4bbedd6ed829ba131133571f1310b9 | git://github.com/neuland/jade4j |
JavaBeanstalkClient | 971e094639c384caa29937b6b793574c03cefd33 | git://github.com/RTykulsker/JavaBeanstalkClient |
java-driver | 7d7047fc78507eeb6ebb1b582eaec036461b5658 | https://github.com/datastax/java-driver.git |
javapoet | 34cfcdf973527ec0f3149d868e55d6600802bf9d | https://github.com/square/javapoet.git |
Java-WebSocket | 58d17786958ec2b629b75de1eed00915b3e4f7c4 | https://github.com/TooTallNate/Java-WebSocket.git |
jbosstools-openshift | 40ce9fca876ec7138e0277ff62965275816b2c1a | https://github.com/jbosstools/jbosstools-openshift.git |
jbosstools-vpe | 85ef65ceba8e900351156afa60178e5abe8617fb | https://github.com/jbosstools/jbosstools-vpe.git |
JGroups | 565fa123057e966efb19f24d43975cf8ab13ceed | https://github.com/belaban/JGroups.git |
jna | e7809ac26d9f1e5034600608d7818b0750eedbfa | https://github.com/twall/jna.git |
jobConfigHistory-plugin | 9fb6df23e3786f45e96ecf38e500c883a6a935d6 | git://github.com/jenkinsci/jobConfigHistory-plugin |
jots | 4c88c256cadf0da27be1e092044bf3bea5c0623d | git://github.com/sparhami/jots |
jsoup | 1dec69d8df78aee955205d8ae8bed0dfe86056f8 | https://github.com/jhy/jsoup.git |
k-9 | 7e43b5848412ad7c0b5a20c578c55eea0aa337d8 | https://github.com/k9mail/k-9.git |
karma-exchange | 0e5c24e972c0c0b2c71dc2246352e1c60a589536 | https://github.com/karma-exchange-org/karma-exchange.git |
katello-api | a3b8078dc093e397bd09cf289d38368eb8e8cd5e | https://github.com/gkhachik/katello-api.git |
LogisticsPipes | f2ea777c1dc240fab2a5698e9e0bd593fbb96fc8 | https://github.com/RS485/LogisticsPipes.git |
lombok | 07b8af4cc5c844c9e085e2c4662df1d08221e710 | https://github.com/rzwitserloot/lombok.git |
maven-android-plugin | 74044942cc35f4e60f80f8d8c42a1c4ec4698363 | https://github.com/jayway/maven-android-plugin.git |
mercurial-plugin | 207888ccba25ed53fd0ea151f96e0dfe79e81cdf | git://github.com/jenkinsci/mercurial-plugin |
mgwt | 375a318a53baf7083282c241c4f751a41ae19e0b | git://github.com/dankurka/mgwt |
mifosx | 97587d90198e8a32c7a3d7f11d4ffa9423971392 | https://github.com/openMF/mifosx.git |
MinecraftForge | 728319cbb5b3f2691d135a109d10f56f4f601abb | https://github.com/MinecraftForge/MinecraftForge.git |
MineFactoryReloaded | 68c87a84c0bacb1da2e00bbbe339964a3d451971 | https://github.com/powercrystals/MineFactoryReloaded.git |
mobile-android | 5bb3383768bc1f417f077472b5a17ad03ae516dc | https://github.com/photo/mobile-android.git |
modeshape | aa80376d183e944d39648f3ecc2a14ee3edb3a2f | https://github.com/ModeShape/modeshape.git |
molgenis | 0de67cf2ffe6ac6d032aa9b387b1dc35035f6ae5 | https://github.com/molgenis/molgenis.git |
mondrian | 671c9df2558677a55d0b3b8ca7efffdcbcc571cf | https://github.com/pentaho/mondrian.git |
mongo-java-server | c121b5b82f2c0effa768961a7dc2ee7523253c92 | git://github.com/bwaldvogel/mongo-java-server |
MonsterIRC | e2eaafe47758b86577ce7027aef7b66c2df615f6 | https://github.com/Monstercraft/MonsterIRC.git |
MSLoggerBase | 8fa875675a7460033c4e9feac23d5ba4ef096d16 | https://github.com/scudderfish/MSLoggerBase.git |
mule | e0a0141b1d4dd43be4afa748d312a1af07655699 | https://github.com/mulesoft/mule.git |
narayana | 5b5b975bdcdba94d1efc5122639ccddee048ab48 | https://github.com/jbosstm/narayana.git |
neo4j | 4fe03c55acce5f3e1ba8ffefddaafa340a760b2e | https://github.com/neo4j/neo4j.git |
netty | d66cf2cbfa604048543594a7ab96bb78d1607186 | https://github.com/netty/netty.git |
nexus | cd395952d84ebb786f39418699c5b921abde3e85 | https://github.com/sonatype/nexus.git |
nexus-oss | 6b57b79c00de5287d8f7dc71f1f04c818c07865b | https://github.com/sonatype/nexus-oss.git |
nifty-gui | ae1721052558ba6e30b8624e16443ec803ed085e | https://github.com/void256/nifty-gui.git |
objectos-dojo | b3f91a4507b625908a362726b5eb77d4c77d7bec | https://github.com/objectos/objectos-dojo.git |
OpenCCSensors | 98759c7d5fb5b62a31f4e3aa85cbc93028a5295f | https://github.com/Cloudhunter/OpenCCSensors.git |
openengsb-framework | d39058000707f617cd405629f9bc7f17da7b414a | https://github.com/openengsb/openengsb-framework.git |
openmicroscopy | 3d60c26ddd1574bfb21f702bb20a756585a5d767 | https://github.com/openmicroscopy/openmicroscopy.git |
OpenTripPlanner | 56111502763f28f391cdca41120c958843d96105 | https://github.com/openplans/OpenTripPlanner.git |
Operation-Valkyrie | d652dbb6eed764898de35bd0b27b5c6d7b15cde9 | https://github.com/MiloTischler/Operation-Valkyrie.git |
Paintroid | f18cfde5952b725f9382c7e364dbb2007fd0cdde | https://github.com/Catrobat/Paintroid.git |
patientview | 248520f2a2e4b3fc1c8f36622b92bf2d02ba0b47 | https://github.com/robworth/patientview.git |
pentaho-platform | 748c021b0e70b8c3f7a3564eac50b3a42ded38f8 | https://github.com/pentaho/pentaho-platform.git |
pentaho-reporting | 6e34562dd2aba77e4e57efbbca021a028f906e46 | https://github.com/pentaho/pentaho-reporting.git |
PermissionsEx | 0fe4ee81198499366af2cd9e39333431c1a15de6 | git://github.com/PEXPlugins/PermissionsEx |
phoenix | 5e49d5f940f9dbd2538fb890f0cc6697068c74ac | https://github.com/forcedotcom/phoenix.git |
picasso | ebce0a70c446b32c6fd7a6f0c5bde595925ecca1 | https://github.com/square/picasso.git |
picketlink | c91f1c1e0a62dbe2fe7af5e107e0ac6f177848ab | https://github.com/picketlink/picketlink.git |
Priam | e0bbaabfa61ab258f5d49c77c7417d232bde57ba | https://github.com/Netflix/Priam.git |
quickstart | 1ce1c381b0563f19f1ca16bc2beab1b587fcaab6 | https://github.com/jbosstm/quickstart.git |
realtalk | 7478dffde69c2cf91afa2d3b8c154e557ec4ef28 | https://github.com/realtalk403/realtalk.git |
reddeer | 0ca7dabe5d8b568e1f22570b3eb46e89f17f29de | https://github.com/jboss-reddeer/reddeer.git |
retrofit | d41d49c5d1e7f09d8062b2521c70b858f6037edf | https://github.com/square/retrofit.git |
riak-java-client | 3daaccea0127c68d3b8deaf0b9d685e85b801358 | https://github.com/basho/riak-java-client.git |
rultor | 978ad592342d970ac1ef94347b93603a1e4f8dc9 | https://github.com/rultor/rultor.git |
RxJava | f8e2136b51ec2c90097087de3f6edd09664f3600 | https://github.com/Netflix/RxJava.git |
seqware | c0f048e12d1c872b0914cb48f347f8b3f8d5f5da | https://github.com/SeqWare/seqware.git |
services | 45a49b49ad7a373fe677b8fc004068c7e3ac33fd | https://github.com/collectionspace/services.git |
Silverpeas-Components | a878a97df977e854012f99423fa80de45bd99362 | https://github.com/Silverpeas/Silverpeas-Components.git |
snap-desktop | b4ff1a3f95ca331028b732859ccb9971ed8e499f | https://github.com/senbox-org/snap-desktop.git |
springside4 | 50f76a2e82bbcc97665d320350aa0ead9bbc101b | https://github.com/springside/springside4.git |
s-ramp | a188b187d8aaa18a6169689a858f95f2c84af7ea | https://github.com/Governance/s-ramp.git |
ssGWT-lib | b7676731b333a45b31f5dbba1209792c899a5425 | https://github.com/A24Group/ssGWT-lib.git |
stripe-java | 889c7c7496436d9630c58efba5cb32d343321b0b | git://github.com/stripe/stripe-java |
SynapseWebClient | 033ad3d04942e0930978c6d277f6f3d3bd3a6cfa | https://github.com/Sage-Bionetworks/SynapseWebClient.git |
systemsgenetics | 42f79a58b9b0d6ac7c9c23a6ec9be2d14e98b00e | https://github.com/molgenis/systemsgenetics.git |
Tardis | d3a48632f8536d4cf784faadb0a4801291fc00f5 | https://github.com/The-Dream-Team/Tardis.git |
testdroid-api | ed872736b42e12177b7f5e0ee1d6cec8cedcb68c | https://github.com/bitbar/testdroid-api.git |
tregmine | b158025d55f891d4b1da30dc2ecde20170f4266b | https://github.com/EmilHernvall/tregmine.git |
udig-platform | f445aae1f9dfc24e81d5f4e123caee5dd889bd5c | https://github.com/uDig/udig-platform.git |
UniversalMediaServer | 82e4b11034c5272bb26c6f90687c4dbdd9f61ee7 | https://github.com/UniversalMediaServer/UniversalMediaServer.git |
Vanilla | bc064f0dc283febcaf925103c931532f150e2bc3 | https://github.com/VanillaDev/Vanilla.git |
vInsert | 696e5fb4652c14576aa0ca33e14208eb4989022c | https://github.com/vInsertOfficial/vInsert.git |
vraptor | 6c36b008e24857075df380e27463b2097b1a146b | https://github.com/caelum/vraptor.git |
vraptor4 | d1120f10825d888cc8d94625b44074e27b9b745e | https://github.com/caelum/vraptor4.git |
webbit | db3b359cbad0cb75cc05d769a1eb260d3cedf038 | git://github.com/webbit/webbit |
worldguard | 93d454c6754db402b4eb64c21876fac3de397193 | https://github.com/sk89q/worldguard.git |
xmemcached | 7eb86628226e5893d8a002ed6cf0f5d9a354c6b9 | git://github.com/killme2008/xmemcached |
xwiki-platform | 0cf2898507eeddb2906b736427c5c39acdffe773 | https://github.com/xwiki/xwiki-platform.git |
yoga | d98f6b0b2b60ff195cc6878ed54e515e639bc9da | https://github.com/skyscreamer/yoga.git |
zanata-server | 82975460dc387eac9cadcc931483ea8c9281dd21 | https://github.com/zanata/zanata-server.git |
ZooTypers | 6aa777d921ebe1042e625b9b8e1ca7b0be629f8d | https://github.com/ZooTypers/ZooTypers.git |
zt-zip | 2e80860ea7aace6413ad5601ef83e166ed4b531f | git://github.com/zeroturnaround/zt-zip |