Skip to content

Instantly share code, notes, and snippets.

@jesperronn
Created June 10, 2010 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jesperronn/432704 to your computer and use it in GitHub Desktop.
Save jesperronn/432704 to your computer and use it in GitHub Desktop.
REM Subversion pre-commit hook for Windows machine
REM put this in your SVN repository folder /hooks/pre-commit.bat
REM we use it with svn version
REM http://stackoverflow.com/questions/869248/windows-pre-commit-hook-for-comment-length-subversion
@echo off
:: Stops commits that have empty log messages.
@echo off
setlocal
rem Subversion sends through the path to the repository and transaction id
set REPOS=%1
set TXN=%2
rem line below ensures at least one character ".", 5 characters require change to "....."
svnlook log %REPOS% -t %TXN% | findstr . > nul
if %errorlevel% gtr 0 (goto err) else exit 0
:err
echo. 1>&2
echo Your commit has been blocked because you didn't enter a comment. 1>&2
echo Write a log message describing the changes made and try again. 1>&2
echo Thanks 1>&2
exit 1
@Gotier
Copy link

Gotier commented Jan 12, 2018

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment