How to require commit messages in VisualSVN server?

后端 未结 10 1918
故里飘歌
故里飘歌 2020-12-07 12:00

We\'ve got VisualSVN Server set up as our Subversion server on Windows, and we use Ankhsvn + TortoiseSVN as clients on our workstations.

How can you configure the se

10条回答
  •  执笔经年
    2020-12-07 12:23

    VisualSVN Server 3.9 provides the VisualSVNServerHooks.exe check-logmessage pre-commit hook that helps you reject commits with empty or short log messages. See the article KB140: Validating commit log messages in VisualSVN Server for instructions.

    Besides the built-in VisualSVNServerHooks.exe, VisualSVN Server and SVN in general uses a number of hooks to accomplish tasks like this.

    • start-commit — run before commit transaction begins, can be used to do special permission checking
    • pre-commit — run at the end of the transaction, but before commit. Often used to validate things such as a non zero length log message.
    • post-commit — runs after the transaction has been committed. Can be used for sending emails, or backing up repository.
    • pre-revprop-change — runs before a revision property change. Can be used to check permissions.
    • post-revprop-change — runs after a revision property change. Can be used to email or backup these changes.

    You need to use the pre-commit hook. You can write it yourself in just about any language your platform supports, but there are a number of scripts on the web. Googling "svn precommit hook to require comment" I found a couple that looked like they would fit the bill:

    • Perl Script
    • Python Script

提交回复
热议问题