Reputation: 169
Is there a way to require certain text in the checkin comment in Visual Studio (currently on VS '15), for certain projects? For source control right now we are using TFVC.
So if I have project SampleProject, and someone makes a change, I would like their checkin comment to say
This text is whatever I want to say about my checkin.
Required Text: Bar
The required text could be one of several different texts (Bar, Foo, etc).
What I am trying to accomplish is a way to automate the versioning of my projects that build in Jenkins. Right now my versioning is set in Jenkins, with the form x.y.z.Jenkins_Build_Id, which overwrites values in the AssemblyInfo.cs. And if I want to increment x/y/z I have to do that by hand, as I haven't found a solution for incrementing those values in an automated way.
But I would like to be able to say if the changesets that caused the build contain 'Major version' then increment x, 'Minor Version' then increment y, 'Patch' then increment z.
Upvotes: 1
Views: 121
Reputation: 31003
TFS provides a default check-in policy named Changeset comments policy, this policy will require users to provide check-in comments. But there is no rule to require comments that include a specific text.
So you can create your own custom check-in policy to do what you're looking for. Check out this link for an example of how to do this, as well as this blog.
Please notice, if your OS is 64-bit, you must add the checkin policy under the Wow6432Node instead of the path stated on MSDN:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\xx.0\TeamFoundation\SourceControl\Checkin Policies
Upvotes: 2