Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

Force comments in commits – Subversion (SVN)

You need to set this up on the server which hosts the SVN repository. Enter the repository and you should see a folder labelled hooks, create a new file labelled pre-commit without any extension and paste the following code inside




$SVNLOOK log -t "$TXN" "$REPOS" | \
   grep "[a-zA-Z0-9]" > /dev/null

if [ $GREP_STATUS -ne 0 ]
    echo "Your commit has been blocked because you didn't give any log message" 1>&2
    echo "Please write a log message describing the purpose of your changes and" 1>&2
    echo "then try committing again. -- Thank you" 1>&2
    exit 1
exit 0


Note: I did not come up with this solution, I will update the source as soon as I can find it again.