SVN 提交后挂钩节省时间?
在我的工作场所,我们已经开始引入适当的 SVN 挂钩,“适当”意味着“进行大量策略检查”。目前,我们的策略由启用了 Perl::Tidy 检查的 Perl::Critic 组成。然而,尤其是后者需要花费大量时间进行提交,涉及多个到多个文件,并且 SVN 在提交后挂钩完成之前不会返回。
有什么方法可以在提交后挂钩中节省一些时间而不牺牲策略检查吗?
At my place of work we've started to introduce proper SVN hooks, "proper" meaning "doing a lot of policy checking". Currently, our policy consists of Perl::Critic with Perl::Tidy checking enabled. However, especially the latter one takes a lot of time on commits with several to many files touched and SVN wouldn't return until the post-commit hook is done.
Is there any way I can save some time in the post-commit hook without sacrificing policy checks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您只需要一些报告(例如错误列表),那么您可以使用Continious Intergation系统运行一些提交后的操作。该系统允许在源代码控制系统发生更改后执行任何操作。以下是示例场景:
有许多优秀的连续插补系统。我喜欢Hudson。
If you only need some report (like list of errors) then you can use Continious Intergation system run some post commit actions. This systems allow to put any action after changes in your source control system made. Here is example scenario:
There are many good Continious Intergation system. I like Hudson.
这是基于分支的开发可以发挥作用的另一个地方。本质上,您为您想要执行的每项任务创建一个新分支。分支免于质量检查,但合并到
trunk
或其他任何东西则不然。因此,您的日常提交速度很快,只是合并速度很慢。您可以通过组建一个机器人来为您完成这项任务来减轻这种痛苦。This is another place where branch-based development can be useful. Essentially you create a new branch for each task you want to do. The branch is exempt from the quality checks, but the merge to
trunk
or whatever is not. So your day-to-day commits are fast, and it's only slow to merge. And you can reduce the pain of that by putting together a bot to do that task for you.如果您希望在钩子说“否”时提交失败,则提交必须等待钩子完成检查。
除了加快检查速度之外,我看不出你还能做什么。 (除了老口号:经常提交。那么你就不会一次提交这么多文件。)
If you want the commit to fail if the hook says "no", the commit has to wait for the hook to finish its check.
Besides speeding up the check, I can't see anything you can do. (Except for the old mantra: commit often. Then you won't commit so many files at once.)