![]() Try this : rem Make sure that the log message contains some text. Fortunately, there are several open source, free, and easy to install Perl packages for the PC such as ActivePerl and Strawberry Perl Unfortunately, it isn't included on Windows computers. By default, Perl comes with Unix, Mac, and Linux servers. This pre-commit script is written in Perl. This is how you check commit messages, but saying that svn:log must match certain regular expressions. Require certain revisions properties to be set with certain values.Very useful for things like making sure Unix shell scripts, Unix Makefiles, and Windows Batch files have the correct line ending, or svn:ignore is set, so users don't accidentally commit in files they shouldn't commit. Require certain files or directories have a particular property set to a particular value.Ban certain file names via regular expressions of globbing,.no-add: Users can only commit changes, and not add or delete files in a commit.no-delete: Users can commit changes and add new files, but not delete these files.This is perfect for the /tags directory where you are allowed to make a tag, but not modify the tag. add-only: User can add a directory via svn cp, but not commit any changes.read-only: User can checkout this item, but can't commit changes.read-write: User can checkout and commit these items.Set various commit permissions against particular files or directories:. ![]() For example, does the commit comment contain a bug number that your defect tracking system uses, so you can trace back the change to a particular defect? Not only can you specify a length, but you can also specify certain parameters. You can match the commit comment against a regular expression.You can specify a minimum length of commit comment.I have a pre-commit hook that can do exactly what you want. More advanced options for the findstr command will let you do fancier checks (certain character sets, ect) 's rather than just one svnlook log %REPOS% -t %TXN% | findstr. So if you wanted a minimum of 10 characters, you need to have 10. If you need a minimum amount of characters, the line to modify is svnlook log %REPOS% -t %TXN% | findstr. This file sits in the /hooks folder of the repository, named pre-commit.bat. 1>&2Įcho Write a log message describing the changes made and try again. If %errorlevel% gtr 0 (goto err) else exit 0Įcho Your commit has been blocked because you didn't enter a comment. Rem Subversion sends through the path to the repository and transaction id It checks for the existence of at least one character in the comment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |