views:

652

answers:

4

Is there a way to set a maximum size for files that can be check in into source control under Team Foundation Server 2005 or 2008?

In the past, when we worked with SourceSafe there were several cases were developers decided to checkin a 500mb data file to source control.

I don't know what such a thing will do to TFS - and actually, I don't want to find out.

Edit: Custom checkin policy is not a viable solution for two reasons:

  1. it is done in the client side - I want the server to protect itself from such an abuse

  2. custom checkin policy can be overridden by the user.

+1  A: 

I don't know TFS specifically, but is there some concept of a "pre-commit hook" as in Subversion? If so, then you could check the file sizes against a maximum there and reject the commit if any files are too large.

Greg Hewgill
+1  A: 

Should be no problem as long as your SQL database has enough space. But anyway you could write a custom check-in policy which checks the file size and does not allow the checkin if it's above your limit.

Martin
+1  A: 

To my knowledge there is no way to do this as you want.

A custom check-in policy is the designed way to implement this type of functionality. The override ability is a built-in failsafe that protects against emergency actions that need to break the policy.

Using the BisSubscribe tool you can set up alerts that send out emails whenever an override is used. This will allow you to verify all overrides and back them out if necessary.

Todd
+1  A: 

When I used TFS 2005, the client-side nature of the custom check-in policy was a real hassle. What you're requesting would quite obviously work best if it were server-side. If a server-side policy implementation solution hasn't been made available in TFS by now, see if there's an easy way to exclude file types.

If the data files you mention are binary, they shouldn't be version-controlled anyway (can't really diff between two versions of a binary file). If they're not binary and they're 500 MB in size, set TFS' permissions to make those files read-only for everyone except an administrator.

Scott A. Lawrence