8

We've recently installed Visual Studio 2012, and I'm working on a brand new project in there with one other member of our team, using Team Foundation Server 2010 for source control. I recently noticed some of my files getting randomly mangled when I check in. Then noticed in the output window notifications about conflicts, which were automatically resolved!?

It turns out this is the default setting in Visual Studio 2012!

I found an article on MSDN detailing how to turn this setting off (http://msdn.microsoft.com/en-gb/library/vstudio/ms181432.aspx#automatic_options), but I'm curious if anyone knows why this potentially devastating setting would be on by default?

Shawson
  • 1,858
  • 2
  • 24
  • 38
  • TFS 2012 has great improvements on merge and conflict management. If that wasn't TFS 2010, I would redirect you to [this link](http://blogs.msdn.com/b/bharry/archive/2011/08/31/merge-enhancements-in-tfs-11.aspx) from Brian; where he notes like: "it’s still configurable and you can use any tool you like but the out of the box one is now WAY better" – Beytan Kurt Mar 15 '13 at 19:04
  • Just to check: conflicts were auto-resolved on "get latest", not during check in? I mean did TFS give a chance to review results of conflict auto-resolution before check in? – maxim1000 Mar 16 '13 at 06:06
  • Sorry yes- I should have mentioned that- it was on get latest- but no, the only way i knew a merge had happened was from a note in the output window. – Shawson Mar 18 '13 at 09:11
  • thank you so much for the link, I was very annoyed by it too – AbsolutelyFreeWeb Oct 10 '18 at 07:21

1 Answers1

7

Because it's the default in most other tools, and people coming to Team Foundation Server found it frustrating that they would have to explicitly tell the tool to automerge. More to the point, people didn't even find it obvious that they would have to explicitly tell the tool to automerge and complained about the sheer number of conflicts produced by merging branches, because in many tools, users aren't even told about a "merge conflict" until it can't be automerged. Thus it appears that Team Foundation Server failed to do a three-way merge properly.

Obviously, the correct default here is a judgement call. I didn't make it, but I support it.

I worry, though, that this change in defaults is exposing some issues in your merge workflow. Automerge can absolutely produce results that a human wouldn't produce, there's no question about that. But it's a well-established standard and generally considered safe, useful and generally correct.

If this is somehow "dangerous" then your process should catch that long before you check in. Hopefully you would have built locally and run a full test pass long before you check in and your continuous integration build would also catch these errors if you failed to do so.

If automerge produces incorrect output, you can always merge the file by hand. And, of course, you can also just turn the automerge option to "off".

Marc.2377
  • 7,807
  • 7
  • 51
  • 95
Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
  • 1
    Thanks for the response- I guess I can see the reasoning behind the change. Yes you're right- it was a get latest and a run of the test suite that highlighted something had been knocked out so we found it before a check in so not a total disaster- I just wasn't expecting it being used to vs2010 which would highlight the conflicts and ask me for each one how I wish to proceed- personally I would never use auto marge and would whip through each file in the manual conflict tool so I can review the final code. – Shawson Mar 18 '13 at 09:23
  • 1
    Understandable. This was indeed a big change between major releases, so I definitely understand where you're coming from. I'll send this feedback to the teams that made this change. – Edward Thomson Mar 18 '13 at 16:08
  • 3
    In previous versions of VS the automerge would fail more often than it wouldn't and could do so in subtle ways (like some resource only referenced in XAML getting lost from a project file) that would often not get picked up for ages. By contrast a person can merge manually with close to 100% accuracy and can be accountable for the merge (rather than blaming the tool), for that reason I blanket banned automerge on my team. Making it the default gave me a very nasty surprise since I lost my local changes without asking me, which must be wrong. – satnhak Oct 18 '13 at 13:49