Reputation: 376
We need to lock our release candidate branches so they only accept true merge commits.
The purpose is to force developers to make their edits in the Main branch (or preferably a developer feature/bug branch) first, and only then merge them into the RC branch(es) from the Main branch. Right now they can make their edits in the RC and commit directly to the RC bypassing the Main branch which is causing a lot of headache with commits that have not been back ported.
Here's an image showing change sets of type "merge, edit" and "edit"
The linked image above shows the history of a file in our RC branch. You can see the change types of "edit" are commits made to the branch directly, bypassing the "Merge from Main" process. Anything with a type of "merge, edit" was committed to the Main branch and then merged in to the RC branch.
So my the overall questions are: Does TFS 2013 with TFVC support the ability to specify that one or more specific branches should only accept commit or file modification types of "merge, edit" and deny "edit" types? If yes, how is this configured? If no, are there any TFS 2013 plugins/extensions that will provide this functionality?
Upvotes: 0
Views: 311
Reputation: 23434
Since you are using TFVC you can create a checkin policy to do this. However it might be better to request or contribute to an existing policy.
You could try the TFVC Branch Policy checkin policy. It does not do what you want out of the box, but you could request that option and it would be very easy to implement.
https://visualstudiogallery.msdn.microsoft.com/81a74866-b313-4f23-b1be-787a57d6c597
They have a GitHub project and you could fork or create an issue...
Upvotes: 1
Reputation: 51103
You could use permission in TFS to achieve it.
Add all your developers in the Contributors group and set the permissions of merge branch to deny. Only allow they work on the developer feature/bug branch, so they can only commit their local code and edits to this branch.
Add your PM or manager in the Project Administrator group, make sure they are not in Contributors. Cause in TFS, any 'deny' will overwrite any 'allow' permissions. So the PM can merge the developer feature branch to Main branch, finally merger main branch to release branch. Such settings can make the management of branch no longer confused.
Find your branch in source control explorer, right click it and select advance, select security. More details of permissions, you can reference this link from MSDN.
Upvotes: 1