Windows SVN pre-commit-hook

At a current project I work on, we use a Windows server to run our subversion repository.

I wanted to set up the pre-commit hook so that commits with empty comment are automatically rejected.

All commit-hook example files that go with Subversion are written in bash (as unix servers tend to be the normal).

Here is a the pre-commit hook rewritten as a windows .bat file.

2 Responses to “Windows SVN pre-commit-hook”

  1. ocpjp Says:

    Below is a section of my pre-hook. It only assigns the first word to the log message and not the entire log. Any idea what is wrong?

    rem Subversion sends through the path to the repository and transaction id
    set REPOS=%1
    set TXN=%2
    for /f “tokens=* delims= ” %%a in (‘svnlook log %REPOS% -t %TXN%’) do (set LogMessage=%%a)

  2. Ray Says:


    Doesn’t you practically override the log message with each iteration of your loop so at the end you only have one word?