How to require commit messages in VisualSVN server?

后端 未结 10 1931
故里飘歌
故里飘歌 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:17

    What VisualSVN offers you to enter as hooks are "Windows NT command scripts", which are basically batch files.

    Writing if-then-else in batch files is very ugly and probably very hard to debug.

    It will look something like the following (search for pre-commit.bat) (not tested):

    SVNLOOK.exe log -t "%2" "%1" | grep.exe "[a-zA-Z0-9]" > nul || GOTO ERROR
    GOTO OK
    :ERROR
    ECHO "Please enter comment and then retry commit!"
    exit 1
    :OK
    exit 0 
    

    You need a grep.exe on the path, %1 is the the path to this repository, %2 the name of the txn about to be committed. Also have a look at the pre-commit.tmpl in the hooks directory of your repository.

提交回复
热议问题