Use hook script to prevent empty log information from being submitted to subversion

Source: Internet
Author: User

This is explained in the help document of tortoisesvn, where the svn repository is configured on the server to prevent the submission of empty log information.

There are some default hook script templates in each SVN repository, where the pre-commit.tmpl is verified before submission, with this for our purpose.

Because the svn server is created in windows, we use the doscommand to implement it:

Code
Rem Pre commit script

@ Echo   Off

Setlocal

Set "Repos = % ~ 1"
Set "Txn = % ~ 2"
Set "Svnlook = G: \ SCM \ SVN \ bin \ svnlook.exe"

For   / F " Tokens = * " % I in ( '% Svnlook % log-T " % Txn % "   " % Repos % " ' )   Do   Set   " Logmsg = % I "
If   Not   " % Logmsg % " = ""   Exit   0

echo no log information is entered! 1 > & 2
echo enter a useful message, which changes have you made to Code . 1 > & 2
echo logs are important information for tracking versions. You must enter them. Thank you for your cooperation. :) 1 > & 2

Exit 500

Save this filePre-commit.batIn the hooks directory of the repository.

Enjoy it!

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.