How to require commit messages in VisualSVN server?

后端 未结 10 1921
故里飘歌
故里飘歌 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条回答
  •  Happy的楠姐
    2020-12-07 12:21

    Use this pre-commit hook on Windows. It's written in Windows Batch and uses grep command-line utility to check the commit length.

    svnlook log -t "%2" "%1" | c:\tools\grep -c "[a-zA-z0-9]" > nul
    if %ERRORLEVEL% NEQ 1 exit 0
    
    echo Please enter a check-in comment 1>&2
    exit 1
    

    Remember that you'll need a copy of grep, I recommend the gnu tools version.

提交回复
热议问题