Force SVN users to write logs in Windows

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.