userimage

Ask users to enter a log message

Hi,


How to create a pre-commit hook in order to show an error when committing without log message (for that commit)? Please help me on this.


Regards,

Sonu
userimage
Moe
The pre-commit hook script written as Batch file in windows OS.
Search for pre-commit.bat file in visual SVN installed directory.
We need to configure the bat file as per our requirement.

Please find the blow in pre-commit.bat file

SET M=

REM Concatenate all the lines in the commit message
FOR /F "usebackq delims==" %%g IN (`%SVNLOOK% log -t %TXN% %REPOS%`) DO SET M=!M!%%g

REM Make sure M is defined
SET M=0%M%

REM Here the <EXPECTED CHAR> is the length we require
IF NOT "%M:~<EXPECTED CHAR>,1%"=="" goto NORMAL_EXIT

:ERROR_TOO_SHORT
echo "COMMENT ON COMMIT MUST BE AT LEAST <EXPECTED CHAR> LETTERS" >&2
goto ERROR_EXIT


Hope this will help you to resolve your problem
userimage

Hi,


I'm using Visual SVN.


Regards,

Sonu

Answer is