A Story of TFS WTFery

I've had it with TFS.  It's a thorn in my side.  It sits there, embedded in Visual studio like ivy on a brick wall, mocking me.  It's like developing in a hot tar pit.  Sticky, smelly, and literally the biggest source of developer pain I feel these days.  I finished up a set of bug fixes and application features that I needed to deploy to QA today.  

One of them was updating a text file.  Easy, right?  Just double click the file!  WRONG.  If you do this you can't save it, you need to open Visual Studio & explicitly check-out the file.  Then you can edit it.  This is done because apparently the developers of TFS decided that Visual Studio is our only editor....

Don't lock my files, bro!

203-41266207d6209dc6

That is a minor gripe, but it's pretty substantial when you think about the fact that I have batch files, a NAnt build, configuration files, and a readme... all of which I'd like to use either Notepad2 or e-texteditor to edit.

If I want to edit a text file, Visual Studio is the last editor on the planet that I want to use.

Then I finish up some other boring SSRS work and commit it to our dev branch.  Our CI build shows success, and I'm ready to merge to integration, which is where we deploy from.  I kick off the deploy process and it fails.  Apparently there was a missing file in the integration branch.

This file was a new file in a directory that was already branched, so when mergine shouldn't it get merged too?  I guess not, because when I go to merge the folder, the new file is excluded.  If you right click & try to merge just the file, it shows no branching targets.  Ok, so let's branch it.  

203-41266207ce9264e2

Branching in the same folder?  Why on earth would you ever want to do that?  That, my friends, is the path to madness.  I correct the path to branch the file into the integration path.

So I finally do my build again, and get more errors.  Reading the build output it looks like some changes still haven't made it over.  I do another merge on this folder and...

203-41266207d6c2f073

then do a diff of the files:

203-41266207d71aed6b

WTFF!

So I guess now I'll need to merge each file, not the directory.  Select the files and...

203-41266207d8308b91

Doh!  You can't branch multiple files via selection like this.  Why?  I'm sure there's a technical reason, but I don't flippin care.  This is an abismal user-experience.

Ok, so I'll branch each one individually....  Merging individually didn't work either:

203-41266207e0fbd402

At this point I'm feeling a little bit like this guy:

60371673_0eb0b14f91

(http://flickr.com/photos/dannyboyster)

So I went to the command-line to try a baseless merge.  You can do that like this:

c:\project>tf merge /baseless <source> <target> /recursive 

This seemed to do the trick.  Time to commit the changes.

Now I'm greeted with a host of conflicts.  I have never made code changes to my target branch.  I have only merged to it.  There should never be an incompatible change!

Now, here's what really gets me:  I get different conflict resolution language depending on if I select a single file or multiple files.

Single file conflict resolution dialog:

203-41266207dfeac2f0

Multiple file conflict resolution dialog:

203-41266207dfcdf012

So which is it TFS?  Source/Target, or Local/Server?  This is so confusing I'm not sure what to do in the latter.  I guess I need discard server version, so I do that.

Two hours after completing my feature work, I'm finally able to check in the changes, do my deploy, and see it running successfully on the QA box.

What a day.  TFS:  I hate you.

#1 Gabe avatar
Gabe
2.05.2009
6:05 PM

have you tried svnBridge? If you were really daring (and really sick of poor source control), you could even try adding git to the toolchain http://ayende.com/Blog/archive/2008/06/26/Git-to-CodePlex.aspx.

Haven't done it myself, but if I had to use TFS I'd be tempted :-)


#2 Kevin Berridge avatar
Kevin Berridge
2.05.2009
6:32 PM

On this: "Now I'm greeted with a host of conflicts. I have never made code changes to my target branch. I have only merged to it. There should never be an incompatible change!"

I'm assuming no one else made any changes between the time you did a get and the time you merged and then checked in right? I've noticed this with TFS too. Why is it telling me there are conflicts because I added a method to a file, and I'm the only person who added anything to that file?! Shouldn't it be able to figure that out?

And the whole dialog verbage thing is a huge point of confusion. It's like Microsoft didn't think anyone would actually try to use branching and merging...


#3 Alan Stevens avatar
Alan Stevens
2.05.2009
7:52 PM

I feel your pain, Ben. For comparison, remember that I am still forced to use Source Safe over a WAN link. No matter how bad it is, it can always be worse.

Let's grab some TFS folk at the summit and see what they have to say about this behavior.

++Alan


#4 benscheirman avatar
benscheirman
2.05.2009
10:03 PM

@Gabe, unfortunately SvnBridge doesn't support branching and merging, which is where I have most of my pain.

@Kevin, Nope, nobody was working on the source today but me. This is a common occurrence, and I'm not sure what caused it.

@Alan, don't you feel you have a professional obligation to stop that madness? The rest of the software development world doesn't even include TFS/VSS in source control discussions or comparisons. Git is gaining in popularity and 90% of the open source projects we use are on Subversion.

Why? Because those tools don't have this kind of friction.

I'm not sure if I trust Microsoft to ever create a useful source control tool.


#5 Keith Bloom avatar
Keith Bloom
2.06.2009
4:28 AM

I think integrated source control with VS is a real pain, leading to the stupidity that you have to manually check out a file to edit it out side of VS.

That said I've been using nothing but VS for years now and it may be better elsewhere.

As for branching and merging, it send shivers down my spine the thought of doing this in TFS.


#6 J.P. Hamilton avatar
J.P. Hamilton
2.06.2009
7:47 AM

TFS seems like just another example of MS arrogance to me. Did they even look at what was being done in the world before they wrote TFS? It is like they had so much confidence in themselves that they couldn't be bothered to do any research.


#7 Eric Matz avatar
Eric Matz
2.06.2009
8:00 AM

This won't solve your branch/merge pain, but go get the latest TFS Power Tool which has integration with the Windows Shell:

msdn.microsoft.com/.../bb980963.aspx


#8 benscheirman avatar
benscheirman
2.06.2009
8:39 AM

@Eric - Thanks for the tip. I'm on 2005 currently (migrating to 2008 very soon) but I'll give it a try.


#9 mknopf avatar
mknopf
2.06.2009
8:55 AM

Ben, I feel your pain. Our (small) consulting firm was on TFS 2005 for 2 years and had all the issues you described here. I clearly remember so many check-ins that had "fighting with source control" as the comment.

We eventually gave up on TFS and migrated to SubVersion which we have been very happy with. I now work for NASA at Kennedy Space Center building software for base operations, we are using Visual Source Safe and I have to tell you that its WAY BETTER then TFS (even though both suck compared to SVN).


#10 benscheirman avatar
benscheirman
2.06.2009
10:42 AM

@mknopf - after using svn I'm surprised you can tolerate VSS.


#11 pfries avatar
pfries
2.06.2009
11:10 AM

TFS doth sucketh, verily. For small-medium sized teams, I have had great experience with SourceGear's Vault. I haven't used their latest ALM tools but, if you're looking for a commercial product and haven't been shackled with TFS, I would recommend it. No, I'm not a shill for SourceGear, just like the product. I want to say MS should have bought them instead of building TFS, but I know they would have bloated it up beyond recognition.


#12 WillieT avatar
WillieT
2.06.2009
11:58 AM

I was gonna say, could be worse, I'm stuck with VSS too. I'm new to the team and have brought it up. Forget merging, I can't even get a "sandbox" going correctly. Having worked with SVN before (I was the lead before) I sorely miss it, but not sure what exactly I can do about it. For instance, FF is banned here, it's only IE6 for us dev's!

Glad I read your post though, I was going to push for TFS as I was assuming it was better than VSS, but in retrospect maybe I'm better off now. Sigh...


#13 Scott White avatar
Scott White
2.06.2009
1:01 PM

I have to use TFS at work and my biggest complaints are how you track defects and everything. Everything feels so canned and crappy. The web interface to TFS is even worse.

I'd much rather use SVN along with Trac or Jira.


#14 James Humphry avatar
James Humphry
2.06.2009
1:26 PM

Cry me a river.... Let's all go back to CVS!


#15 benscheirman avatar
benscheirman
2.06.2009
1:41 PM

@James - There are better tools out there, yet so many Microsoft shops continue to choose this crap over better alternatives. Your willingness to be content with inferior tools is directly related to your professionalism as a software developer.

I wouldn't want to work with PVCS, CVS, VSS, MKS, or any of the other crappy source control systems.


#16 Sumith Damodaran avatar
Sumith Damodaran
2.06.2009
2:05 PM

Have you ever tried Dubbelbock, a great free tool for TFS explorer integration. works same as tourtoise SVN.

www.benday.com/.../displaywebpage.


#17 benscheirman avatar
benscheirman
2.06.2009
2:31 PM

@Sumith - Yes I've tried it, and I know its creator, however it is not the same as TortoiseSVN. You can not select multiple files to check in, for example.

It is useful when you want to "Get Latest" or check out a single file.


#18 Kedar Sirvahna avatar
Kedar Sirvahna
2.06.2009
9:07 PM

Mr. Ben,

It seems to me that you do not fully understand the power of Team Foundation Server. Compared to its competitors it is light years away. I agree its a1st / 2nd release product with hiccups but all in all it is a very productive product. Do you have any suggestions on superior products? Would you mind blogging about their pluses and minuses? Much appreciated...

--

Kedar


#19 benscheirman avatar
benscheirman
2.06.2009
11:17 PM

@Kedar - The "power" of TFS is using not just source control, but integrating work items, check-in policies, planning, reporting, etc...

But each of those items by itself is nothing great. They are a bunch of mediocre tools all tied up and integrated into Visual Studio.

In our project we ended up abandoning updating & keeping track of work items because they were next to useless. Excel would have been better. Sure you can customize the template, but I wasn't confident that it would be better than cards on a whiteboard. So that's what we did.

Specifically for source control, I much prefer subversion. Excellent command-line interface, excellent support in Explorer with TortoiseSVN, and excellent integration with VisualSVN or AnkhSVN. Subversion is fast, easy to learn & use, uses a superior edit-merge-commit model rather than the check-in, check-out library metaphor, and has excellent support for branching and merging.

Most of these are said to be "better" in Git, but I haven't yet taken that plunge.


#20 mknopf avatar
mknopf
2.07.2009
11:15 AM

Ben (response to #19)

After working with TFS for 2 years and then migrating to SVN (not to even mention my horrible experience with CVS) I have found that SVN is by far the better choice, especially when you consider its price (COMPLETELY FREE!!!!!) and the tools used to interact with it (AnkhSVN and TortuseSVN) are also COMPLETELY FREE (I didn't see the value in the VisualSVN plugin so i didn't buy it, but man I LOVE VisualSVN Server!!!)

Right now here at Kennedy Space Center we are on the NASA network and therefore our computers (all of them including DEV and source control servers) are owned by Lockheed Martin (they have the contract to manage them) and are under a Federal Mandate. That mandate prevents our developers from having IIS or any kind of web server, any kind of Database server, as well as ADMIN rights on our own machines (this is a Federal Law since we work for the government).

This introduces some very interesting constraints when it comes to developing software hence the VSS requirement. However I am hoping we will be able to build our own internal network that is not on the NASA pipe and therefore eliminates all the issue is described above, once that happens we will use SubVersion for sure. But in the meantime its "welcome to working under the Federal Governments guidelines"


#21 Erik Lane avatar
Erik Lane
2.07.2009
2:00 PM

I'm so glad to see posts, as well as comments, like this and makes me even more thankful that we opted for SVN over TFS.


#22 Robz avatar
Robz
2.09.2009
12:12 PM

Ben, I feel your pain. Oh wait, I mean I FELT your pain. :D

"Dear MS: I trusted you for source control w/TFS2005. I trusted you for 3 years! Today you failed me and that trust can never be repaired. "

twitter.com/.../1119180977

"Good morning SVN. Good bye TFS."

twitter.com/.../1152090261


#23 Jason Barile avatar
Jason Barile
2.10.2009
12:44 PM

As far as locking files, this is the big difference between SVN's model and TFS's model, where the server knows about the state of files and what exists and what doesn't. You can always check out the file for editing first, then open it with any editor you like. If you edit it from within VS, it's going to use the editor for that file type specified under tools/options. If you open it from Windows Explorer or the cmd prompt, of course you can open it with whatever you like. The key is that before you edit it, you should check it out for editing, which unlocks the file.

When you tried merging the new file from the branch back up to the integration branch, had you added it to source control yet & checked it into the child branch? If not, then it would still be in the "pending add" state and the merge operation wouldn't include it. Just trying to understand your scenario better here.

Is your integration branch the parent or child of your working branch? I'm assuming it's the parent here. I agree it's frustrating that trying to merge just the new file from the working branch to the integration branch shows no branch targets. TFS 2008 SP1 has the same behavior. It's because the file itself was never branched (since you created it in the child branch). If, however, you select the parent folder of the file (which WAS branched), TFS merge will correctly detect the new file and merge it back up to the parent branch. But I completely understand why you'd want this to work the way you assumed it would. As a user, I don't think you should need to understand the subtle details of why it doesn't detect a branch target... it should just work.

Where you're branching a file, what would you prefer to see happen there? I think what you'd rather have happen is what I described above. If you branch that file from the working branch into the integration branch, then what you end up with is a single file in your integration branch that is essentially a branch "grandchild" of the integration branch. Typically what I'd do here is to merge from a folder at the highest point in your child branch that includes all the changes you want to merge back into the integration branch. Comments aren't doing this justice... it's be easy to explain with a picture.

re: Merge language changing based on picking a single or multiple files - good call... that's annoying. This experience has been updated in TFS 2010, but TFS 2008 SP1 is still essentially the same as what you show here.


#24 Matt Mitrik avatar
Matt Mitrik
2.10.2009
5:11 PM

I'm not exactly sure how you're performing the merge between the dev branch and the integration branch, but if you merged at the branch roots, and the range of changesets you were merging contained the files added on the branch, they should be merged to the integration branch. I've heard of other people running into problems here if their workspace wasn't up to date, or they specified a list of changesets or a range that didn't include the adds.

A few tips for keeping the number of conflicts down in the future:

1. Avoid baseless merge. I think you tried to avoid doing this until you got stuck with the merge not bringing changes over. Performing baseless merges will always conflict because there is no base for the server to use as a reference point.

2. Forward integrate / rebase before merging to a parent. This doens't truly eliminate conflicts, it just forces them to surface on the branch with changes (in this case, your dev branch). That way, you can try out resolving them, perform a local build on the dev branch, and when that is successful, check-in on the dev branch. After that, you should be able to merge to the parent branch (here, integration) and not have to deal with conflicts or wonder if your build will be broken.

Regarding merging multiple files - you're right, this could definitely be improved. I'll put an item on our backlog to track it for a future release.


#25 James Humphry avatar
James Humphry
2.11.2009
10:03 PM

From reading Jason and Matt's posts it seems like you've been spending too much time blogging and not enough time learning the tool your employer has asked you to use. I guess that is directly related to your professionalism as a software developer.


#26 benscheirman avatar
benscheirman
2.11.2009
10:12 PM

James, source control shouldn't have to be this annoying. It's one of those core things that you shouldn't have to worry about. My frustrations with TFS have really peaked, and I decided to blog about it.

Your professionalism as a software developer is measured in many ways, and one of those is looking out for better ways. As a consultant who works with .NET, 90% of our clients use (or are looking to use) TFS. Hopefully my rant post will convince someone out there to take a 2nd look at SVN or Git over TFS and that's good.


#27 Eric Popelka avatar
Eric Popelka
2.12.2009
2:46 PM

@James

troll detected


#28 Simon avatar
Simon
2.16.2009
5:20 AM

the solution to all your TFS woes is SVNBridge


#29 OmarV avatar
OmarV
2.20.2009
6:02 PM

Ben,

I was going through your post and thinking what I was going to comment. Then I got to the comments and Eric, Jason and Matt already said what I wanted to say.

I have seen people have the same frustrations you've had and believe me, you are just a few minutes of training away from not being as frustrated. As James said, being in consulting you will probably end up at another engagement where your client will ask you to use TFS and I think I can help you ease that pain... but you'll have to show me some of basic SubVersion stuff in exchange ;-). I have heard a lot about SVN and never had an opportunity to work with it. If you are going to the summit we could get together at lunch, we really don't need that much time. think I have an old TFS2005 VPC I can bring with me. And if I don't have it anymore, TFS2008 is not much different in regards to the issues you had, we could use a 20008 VPC.


#30 benscheirman avatar
benscheirman
2.21.2009
9:28 PM

Omar,

Thanks for your post. It really is encouraging, and I really do want to make it less painful for me, believe me! You're right on about consulting, and as my company does ALM assessments and TFS installs, I'd be actively fighting them to get (IMO) better tools that aren't Microsoft approved.

I do have to be honest though, how can you not have spent any time with Subversion? It is (currently) the defacto standard for open-source projects. It is free. It has a free ebook. I'd be happy to show this to you in person, but in the meantime there are a billion resources on the net that show how to get started :)

Definitely find me at the summit and we'll chat. Thanks for the comment.


#31 OmarV avatar
OmarV
2.22.2009
12:29 PM

Yeah, I know. I just have not had the opportunity to work with it. Some of my coworkers at Notion have but not me. I would have already read a lot about it otherwise and would have it installed, etc. if I had to know it before going to a client's site that uses SVN. You know how consulting is, you work full time at your client's site and you do reasearch and studying before and after work to maintain the level of service. See you at the summit!


#32 Fangspeen avatar
Fangspeen
3.19.2009
4:16 AM

I would love to hear about the out come of this discussion you plan on having.

Please keep us up to date.

Having used SVN, and then been made to use VSS. I eventualy got my coworkers convinced to atleast move over to TFS2005. I would have to dis aggree with any one claiming that VSS is less painfull.

We Recently migrated to TFS2008 SP1 which resolved some of my more serious gripes with TFS, how ever many of your issues have plagued me also, especially since I have to help my coworkers resolve these issues when they arise. Most frequently this leads to them circumventing source control by:

* Checking out every file in a project and replacing it with some obscure version they "backed-up" to their local file system at some point and then checking the whole project back in again!

* Checking out individual files and manually copy and pasting changes from another branch before checking back in!

* Applying changes manually to each branch instead of even attempting a merge!

I tell you some days I just want to curl up in a corner and cry.


#33 OmarV avatar
OmarV
3.26.2009
11:20 AM

I was not able to get with Ben at the MVP Summit but I emailed him afterwards and we are planning on doing this over LiveMeeting. Hopefully we can do it next week... Ben?


#34 benscheirman avatar
benscheirman
3.26.2009
11:22 AM

Next week is going to be hectic for me. The week after would be better. Thanks for persisting on this Omar.


#35 drventure avatar
drventure
3.30.2009
2:41 PM

Good stuff. I made all the same comments about TFS when I evaluated it, only to be told halfway through my (not flattering) presentation that TFS had already been decided on.

Sigh.

And SVN is freakin' FREE. But it's open source, and everyone +knows+ how scary that stuff is....


#36 Josette Rigsby avatar
Josette Rigsby
4.06.2009
1:41 PM

I didn't read all of the comments, but I hate IDE integration. I'm definitely a SVN (or even Perforce) fan. I use TFS @ my new company. However, I use the power toys file system integration. It's not quite double click, but it's better than opening VS.


#37 jwc avatar
jwc
4.15.2009
5:13 PM

I'm gonna 2nd the motion for SourceGear Vault. Much more sophisticated than TFS. But you still have to have a tool to check files out I think.

Anyway, yes TFS is a real pain in the neck. MS seems to have missed a step called "see what the state of the art is" when they set out to build it.


#38 rob avatar
rob
5.15.2009
5:43 PM

As someone previously mentioned... a few minutes understanding what is going on (and how to use the tool) would eliminate these confusing/frustrations.

We can all go back and forth about particular messages and wording that needs edited, and that's fine. But the core of what you are complaining about is realy a non-issue regarding TFS. TFS is not VSS. It is not a simple little tool to help you with check-ins. It's a complicated beast that needs to be well understood. If that breaks your model, then it isn't for you. If you need to use it in a prefessional manner, then it's more than capable of delivering what you expect.

The system is amazingly extendable. I realize not everyone wants (or has the chance) to take time to understand how to extend it. But there are plenty of free/open source solutions to solve many of the common "complaints".

The assumptions you have made about TFS's "failures" are no more than misunderstandings by the user. There are legit reasons you are expiriencing the situations that you see. If you don't have the time to understand that, and another off the shelf tools matches your world better then go for it. All that means is that someone with a different view would write a differnt post about a different WTFery. And the rest of us who need to get some serious development done (and need an enterprise level source system that plays very nicely with it's ticketing/tracking/notifications/etc and happens to be a plug-in to our IDE) will continue enjoying TFS and the great features that it has provided to our team.