Skip to content

Instantly share code, notes, and snippets.

@olleolleolle
Forked from jesperronn/pre-commit.bat
Created June 11, 2010 07:40
Show Gist options
  • Select an option

  • Save olleolleolle/434197 to your computer and use it in GitHub Desktop.

Select an option

Save olleolleolle/434197 to your computer and use it in GitHub Desktop.
[useful] Subversion pre-commit hook for Windows machine
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
@empackcarriagada

Copy link
Copy Markdown

Se agradece era justo lo que andaba buscando

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