DEV Community

nita daniel
nita daniel

Posted on

Yes, We Still Use TFS

My employer uses Microsofty technologies in its backbone. We have a large, entertwined codebase that loads 150+ projects at once, and yes, we still use TFS, not git.

We mark some items for manual merge due to the quirks of our processes, using Visual Studio slns, and Reasons, okay, for reasons.

The problem?

No, the answer isn’t that we still use TFS, and not distributed version control. I mean it is an aspect, but that’s not the problem. The problem is we have years of unmerged items due to some checkins requiring careful hand merging or manual changes.

Just trust me. For Reasons.

TFS means VisualStudio, and merging in the Visual Studio UI means retrieving merge candidates. And that list is long.

I don’t much care for lifting my hands from the keyboard, much less waiting for long lists to load OVER AND OVER, so, for the standard merge, I wrote a powershell script. Wait. No. I went further and wrote a MODULE.

Demo of performing a merge with my powershell

I could have used a library but our needs are simple.

  • Merge a changeset or range of changesets
  • Make the original comment (where we have a standard of including the work item ID as well) easily accessible.

This module isn’t not perfect. It doesn’t automatically setup or detect workspaces. It doesn’t checkin the subsequent merged files. You have to open it up and update

  • The path tfs.exe is suitable for your machine, are any paths to where you keep your local versions of the codebase.
  • That you’ve defined the names of any projects and your project default
  • The url to the collection on the server

If you want a reminder, this is what command line merging with tf.exe looks like when you have it in your path, and no workplace shenanigans or mismatches

cd <local directory with repo files>
tf vc merge /recursive $/VersionControl/Source/Path $/VersionControl/Destination/Path /version:C<ChangesetId>~C<ChangesetId>

And now I have

Merge-Code Dev Test 12345

Instead. Less to remember. Less to edit. Faster.

Merge conflicts open in their own window, and the pending items show up in VS. The script copies the checkin comment of the first changeset in the range, and I paste that in without having to look it up.

Not exciting, is it? But it vastly speeds up our workflows.

Get the goods

Top comments (0)