How do I create a SVN Commit Message Template and Hook to Verify

Justin picture Justin · Jun 11, 2009 · Viewed 34.6k times · Source

I'm using Visual SVN Server and Tortoise SVN (client) for source control. I would like all developers to standardize on a consistent format for checkin notes.

For Example I want their Commit Message to default to...

Synopsis:

Developer Name: (pre-populated)

Reviewed By:

[Bug Id]:

[Change Bug State]:

Known Issues:

Affected Files: (pre-populated)

In the future I'd like [Bug Id] and [Bug State] to supply the information to trigger an automated update to the Bug Tracking system. Also Developer Name and Affected Files should be prepopulated with the svn user and files that the user is commiting.

Please send any links or samples you may have.

Answer

Justin picture Justin · Jun 24, 2009

Taken from How to create a Tortoise SVN Checkin Template (modified to fit to more current versions):

The log template can be customized as per the project requirements and can be used to implement strict log format.

Adding this to your svn repository is easy :

  1. Select a SVN folder to which you want to apply this go to Subversion properties( right click TortoiseSVN -> Properties)

  2. Select New -> Advanced, then tsvn:logtemplate from the drop down list named Property name.

  3. Add the above templates(or your own) to text area below combo box.

  4. If you want to apply the property to every file and folder in the hierarchy below the current folder, check the Recursive checkbox.

  5. Click on OK to add that property to the list.

  6. Check-in all the folders and files so that everyone else in your team can use the same template.