Applies to: VisualSVN Server 3.9 and later
VisualSVN Server includes a pre-commit hook that allows putting certain restrictions on the log messages for the new commits. Typically, you might want to prohibit empty log messages or log messages that are too short.
Follow these steps to enable the pre-commit hook:
- Start the VisualSVN Server Manager console.
- Expand the Repositories node.
- Right-click the repository and click Properties.
- Click the Hooks tab.
- Double-click the Pre-commit hook.
- Enter the following commands replacing the parameters with valid values.
"%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" ^ check-logmessage "%1" -t "%2" ^ --min-size <min-size> IF ERRORLEVEL 1 exit /b 1
- Click OK and Apply.
Note
Do not forget to use IF ERRORLEVEL 1 exit /b 1 or a similar condition
after calling VisualSVNServerHooks.exe in the hook script. Otherwise,
the results of the check may be silently ignored.
The check-logmessage command accepts the following options:
Option | Meaning |
-t [--transaction] ARG | Specifies the transaction ID |
--min-size ARG | Minimum allowed number of characters in the commit log message |
Example: reject commits with less than 10 characters in the log message
Use the following pre-commit hook to reject commits with less than 10 characters in the log message:
"%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" ^ check-logmessage "%1" -t "%2" ^ --min-size 10 IF ERRORLEVEL 1 exit /b 1