People in many cases, rely on conscious or moral, is not enough. Rules must be allowed to enforce compliance. Programmers are people too, you need rules.
When submitting SVN, if there is no comment at the time of inspection history, it will be very inconvenient. So we need to have a time to let programmers submit code, mandatory rules to add a comment. Let's look at how to achieve in SVN.
1. recommend using VisualSVN as a server (free download address: http: //www.visualsvn.com/). After installation, open the VisualSVN Server Manager, click on "Properties" in the repository, select the "Hooks" option, select the "Pre-commit hook", click "Edit". (As shown below)
OFF @echo setlocal the SET REPOS =% 1 the SET TXN =% 2 REM LogMessage the contains the Check that AT Least 10 characters REM ..... behalf of five characters svnlook log " % REPOS% " -t " % TXN% " | findstr " ..... " > NUL IF % errorlevel% GTR 0 GOTO ERR Exit 0 : ERR echo upload failed! Please add comments. Comment length of at least five characters. Aborted the Commit! . 1 > & 2 Exit . 1
OK to!