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

Re: Pre-commit hook set to fail if build fails

From: Ryan Schmidt <subversion-2005_at_ryandesign.com>
Date: 2005-11-10 23:36:08 CET

On Nov 10, 2005, at 22:42, Mark Shead wrote:

> I'm looking for a mechanism that will let me setup Subversion so
> whenever someone does a commit, it first checks to make sure that the
> project builds and that the tests pass. If it doesn't pass, it
> rejects
> the build.
> Is this possible? How do I get the contents of the current commit
> even
> though they are not yet committed to the repository?

Unless you can compile your project in a few seconds, that's probably
not going to be feasible. Every time your users commit they will be
waiting for it to do a probably non-instant compile. And while that
one user is waiting, no other users can commit either; if they try,
they'll be waiting even longer.

What's usual is to do just a minimum of testing in the hook, and then
let the commit succeed. Then have an automated build that runs
nightly or more often if you like. If the build doesn't work, then
send an email to the development team saying it's broken, and maybe
showing the log of commits that happened since the last time it
worked right. That way the user responsible will know it, everyone
else will know it, and it will encourage developers to ensure they
only commit working code in the future.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Nov 10 23:38:27 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.