Under the repository hooks directory, add the pre-commit.bat file and add the following content
@ Echo off
::
: Stops commits that have empty log messages.
::
@ Echo off
Setlocal
Rem subversion sends through the path to the repository and transaction ID
Set repos = % 1
Set txn = % 2
Rem check for an empty log message
Svnlook log % repos %-T % txn % | findstr ......> NUL
If % errorlevel % gtr 0 (goto ERR) else exit 0
: Err
Echo Log message must be longer than 10 characters! 1> & 2
Exit 1
There are two points to note, one is to set the bin directory in the installation directory of the Subversion to the system path, otherwise the svnlook cannot be found, of course, directly set in the pre-commit.bat can also
The second is findstr... the number of Chinese points indicates the minimum length of log (English character length), which is limited to 11 characters.