开发者

Avoid non pre-tested commit in SVN commits

开发者 https://www.devze.com 2023-01-13 03:20 出处:网络
开发者_如何学GoPlease help me with this: how can Avoid non pre-tested commit in SVN commits???You can\'t really force anybody to do anything before committing*, all you can do is test the committed co
开发者_如何学Go

Please help me with this: how can Avoid non pre-tested commit in SVN commits???


You can't really force anybody to do anything before committing*, all you can do is test the committed code at each time.

To quote @Thomas Owens from the comments :

Educate people who break the build on the importance of testing their code before it hits the repo.

With a particular environment you could use something like teamcity which could solve your problem. But in the end anybody can commit anything on your SVN.

There are better ways to test your application. For example like

The pre-tested commit example on teamcity

* In fact you do, you can use the hooks of your SVN (see comments below), but in your case it would be a really bad idea.


The most reasonable thing you can do is set up a continuous integration environment which performs a full build after each commit, and urge your team to run tests before commit.


Please try using SVN hook scripts, like, for example post-commit, precommit, they are not the same in every operating system. But they are way useful!

Of course you should have to write your own logic combining hook scripts with some script that tells you when a code have been tested or not.

For more information look under your repository base folder, inside a folder named hooks, and you will see a whole new world!

Hope this helps,


For the situation where you want to commit code but you dont want to affect/break anything else one thing you can do is create a branch and commit your code to that. After you're satisfied that its tested and is ready you can merge those commits into the truck.


Quickest way would just to tell the ones comitting to do it by the book right? Or is that blasted human factor to much of an issue at this point for you ?


SVN doesn't seem to be any good supported for pre-tested commits.

However, if git is also an option for you, than you may want to take a look at Pre-tested commits with Git and pre-tested commits with Hudson/Jenkins

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号