0 local, 3 server, 0 both, 0 conflicting

So you may ask what is that string that you have as the title of this blog post? and why are you blogging about it?

Well, the string comes from our resolve feature and it gets presented to you when you are resolving conflicts. The reason why I am blogging about it is because I was asked for an explanation of the meaning of "both" and for more details on how and when these get computed ... and as I was getting ready to answer I realized I simply did not know.

Now, I know there is a lot of room for improvement in my career and knowledge of version control but what stuck to me is that if I did not know just by looking at it then some percentage of our customers were probably on the same boat. The next step is logical, blog about it so people can find the answer in a time of need.

When does it get computed?

The answer to this is very simple. In the TFS 2005 and 2008 releases we compute this when you click resolve from the resolve dialog. This presents you with a second modal dialog with the details of that conflict. In the next release it will only get computed after an AutoMerge is executed.

What does it mean?

Before explaining what each of the labels mean the main thing to understand is that this is calculated by our diff engine and our diff engine tries to be efficient by dividing change regions into chunks or paragraphs. A side effect of this are cases where you add 5 lines but our diff engine thinks of that as a chunk and hence display only one total change region.

N local - refers to the total lines or chunks modified ONLY in the local version of the file. We calculate this by performing a diff between local and original/base.

M server - refers to the total lines or chunks modified ONLY in the latest version of the file. We calculate this by performing a diff between server and original/base

O both - refers to the total lines or chunks modified both in the local and the server which are identical. It means both people added, changed or deleted the same content. We calculate this by calculating a base and then performing effectively a three way diff

P conflicting - refers to the total lines or chunks modified both in the local and the server which are in conflict. This means that the content changed was different. Think about it as both but conflicting.

There you have it, hopefully this explanation helps you understand them better!

Now another question I get is why does it sometimes says 0 conflicting but a conflict was filed?

The answer lies in the nature, type and definition of the conflict. For us there are two categories of conflicts:

  • content conflicts - is what this label tries to represent. In a nutshell, there were changes made in the local and in the server to the same region or lines of code which are now conflicting
  • TFS conflicts- these are divided in types like version, writable, filename collision, etc

A version conflict just tells you that there is changed content on the server that you don't currently have and in addition we do not know if it is the same or different from your local edits. That result in a conflict filed and when we perform the auto merge we might then realize that there is nothing really conflicting.

On another note, if I step back I see one flaw in our system and that is the inability to tell you if the chunks we picked were the right ones which puts in question the accuracy of the information provided. For source files we are confident that it does a really good job, but for things where changes happen together and each line does not depend on the line above or below the algorithm may not be the best at stating how many relevant lines really changed. In the future, we are going to take a look at this and see how we can still display the information to the user in a way that is easy to understand from day one.

- mario