[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: Mark Shead <sheadm_at_optimalinternet.com>
Date: 2005-11-11 03:25:54 CET

That is what we are currently doing. In certian places though I'd like the commit to fail unless it builds correctly. It sounds like when you check things in, it creates a transaction and then fires off the pre-commit scrips. If the script exits with a status of 0 the transaction is committed.

What I'd like to be able to do is use the script to copy the state of the transaction out to a directory and run the build script. If it builds then I want the transaction committed. If not I want it to abort and the user to be notified.

Obviously this means we'd have to wait around for the build to finish, but in our situation that would only mean a few minutes. The benefit would is that we wouldn't ever have a case where it works on the developer's machine but not on the integration server.

Is this possible?

Another possibility would be to fire off a build using a post-commit script and then just backing out the changes if the build fails, but I'd rather have the feedback comming directly from subversion's client when they commit.

Any suggestions or comments would be appreciated.

-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2005@ryandesign.com]
Sent: Thu 11/10/2005 5:36 PM
To: Mark Shead
Cc: users@subversion.tigris.org
Subject: Re: Pre-commit hook set to fail if build fails
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 Fri Nov 11 03:27:45 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.