ShadowKras
ShadowKras

Reputation: 343

How can i force meaningful checkin comments on Team Foundation?

I have a team of developers that have a bad habit, they write poor checkin comments, which makes it a nightmare when we have to look at a file's history on team foundation. I have enabled the Changeset Comments Policy, so they can even leave a comment on their checkins (otherwise they wouldn't).

We had a few discussions about work quality for the team, and they are fine with things to remind them to follow stabilished rules for the team, such as being forced to comment. The objective here is to make TFS warn them that they have to write something longer than "Fixed an issue" or "Updated", which they are fine to follow if enforced. I am in charge of the frameworks for our application, and i usually write messages to remind them of things, similar to how VS warns them for missing comments or broken code

Now, i want to avoid that they simply comment a single word, or even a dot on their checkins. I want to force that at least 20 characters are written before they can checkin the changes. Is this possible? How can it be done?

We do not work with a build server or work items (we use redmine for tickets).

Upvotes: 4

Views: 1193

Answers (2)

Daniel Mann
Daniel Mann

Reputation: 58980

This is a cultural problem, trying to solve it with technology is a dead-end. If people aren't writing meaningful commit messages as-is, do you think that forcing them to write 20 characters is suddenly going to make them start writing meaningful messages, or do you think they'll write garbage messages that are longer, like "checkin checkin checkin checkin" or "stuff ..................................."?

My money is on the latter.

Although you could write custom check-in policies, they're not perfect:

  1. They only work with Visual Studio
  2. They can be circumvented by just deleting the policy assembly
  3. They don't apply to editing via the web interface in TFS 2015+.
  4. There's no equivalent for Git repos
  5. They have to be upgraded in lock-step with Visual Studio/TFS versions, which can make upgrades more difficult down the line

And most importantly:

  1. They don't solve the cultural problem of developers not understanding the value of meaningful, verbose commit messages

Upvotes: 2

Kevin
Kevin

Reputation: 1536

It seems you can write your own custom policies. You can refer to this page for more information:

http://blog.devart.com/creating-tfs-custom-check-in-policy-part-1.html

And here is an example where comments are accessed:

https://msdn.microsoft.com/en-us/library/bb668980.aspx

Upvotes: 0

Related Questions