Force write comment When SVN file is submitted

Source: Internet
Author: User

This operation needs to modify a hook file in the repository, there is a hooks folder in the repository you created, and at the beginning there is a file called Pre-commit.tmpl

Modify it to pre-commit.bat under windows and change it to Pre-commit under Linux

Under Linux (the file name is: Pre-commit, placed in the repository's/hooks directory)
==========================================================

#!/bin/sh
Repos= "$"
Txn= "$"
Svnlook=/usr/bin/svnlook

# Check this logmessage contains at least alphanumeric characters
logmsg= ' $SVNLOOK log-t "$TXN" $REPOS "| grep "[A-za-z0-9]" | Wc-c '
If ["$LOGMSG"-lt 10];
Then
Echo-e "/nempty log message not allowed. Commit aborted! " 1>&2
Exit 1
Fi

Under Windows (Save to Hooks folder under Repository/hooks/pri-commit.bat)
=================================================================

@echo off
Setlocal
Set repos=%1
Set txn=%2
REM Check that logmessage contains at least characters
Svnlook Log "%repos%"-T "%txn%" | Findstr "..." > nul
If%errorlevel% GTR 0 goto ERR
Exit 0
: Err
echo You must enter at least 5 characters! 1>&2
Exit 1

Force write comment When SVN file is submitted

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.