[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Subversion Hook to enforce a bug ID in the log commit message

From: Chris Jensen <cjensen_at_edex.com.au>
Date: 2005-11-21 22:54:12 CET

> I'm looking for example of pre-commit hook to enforce a bug ID to be
> entered in the log msg when performing a commit in a repository.

Off the top of my head, how about something like

REPOS="$1"
TXN="$2"

$SVNLOOK log -t "$TXN" "$REPOS" | \
   egrep -iq "bug \#[0-9]" || echo "No bug id" && exit 1

This will abort unless the log message contains something like "bug #5"

Chris

-- 
---------------------------------------------------------------------
Chris Jensen cjensen@edex.com.au
Educational Experience (Australia)
Postal Address: PO Box 860, Newcastle NSW 2300
Freecall:       1-800-025 270      International: +61-2-4923 8222
Fax:            (02) 4942 1991     International: +61-2-4942 1991
Visit our online Toy store! http://www.toysandmore.com.au/
---------------------------------------------------------------------

Received on Mon Nov 21 22:57:22 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.