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

Re: Excluding directories on a sticky basis

From: Christopher Ness <chris_at_nesser.org>
Date: 2005-01-04 19:57:41 CET

On Tue, 2005-04-01 at 02:43 +0100, Jonas Widarsson wrote:
> Is this possible?

Try a pre-commit script to reject commits with whatever "sticky dirs"
you do not want to commit.

This is not optimal since the entire commit is rejected and forces the
developer to figure out why it was rejected (a good pre-commit script
would write the reason to STDERR).

Here is a simple example that rejects commits to any repository URL with
the word tag in it. YMMV based on how well you can write programs to
verify transactions.

#########################################################
# Make sure that the log message contains some text.
SVNLOOK=/usr/local/bin/svnlook

# Don't allow commits to anything in the "tag" directory
${SVNLOOK} changed -t $2 $1 | grep "^U\W*tag" > /dev/null && /bin/echo
"Cannot commit to tag directory
Try /trunk or /branch!" 1>&2 && exit 1

# All checks passed, so allow the commit.
exit 0
#########################################################

More info here:
http://svnbook.red-bean.com/en/1.0/ch05s02.html#svn-ch-5-sect-2.1

Cheers,
Chris

-- 
Software Engineering IV,
McMaster University
PGP Public Key: http://www.nesser.org/pgp-key/
13:48:49 up 1 day, 15:32, 1 user, load average: 0.12, 0.15, 0.15 
http://www.fsf.org/philosophy/no-word-attachments.html

Received on Tue Jan 4 20:00:05 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.