SVN 提交后挂钩节省时间?

发布于 2024-08-08 10:58:02 字数 188 浏览 7 评论 0原文

在我的工作场所,我们已经开始引入适当的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

十秒萌定你 2024-08-15 10:58:02

如果您只需要一些报告(例如错误列表),那么您可以使用Continious Intergation系统运行一些提交后的操作。该系统允许在源代码控制系统发生更改后执行任何操作。以下是示例场景:

  • 有人提交到 SVN 存储库
  • 一段时间后,CC 发现了此更改并运行脚本:
    • 从 SVN 获取最新版本
    • 运行 Perl::Critic 和 Perl::Tidy 等检查
  • 如果任何检查失败,则
    • 创建详细的错误报告(可从网络获取)
    • 如有必要,发送电子邮件通知

有许多优秀的连续插补系统。我喜欢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:

  • Some one commit to SVN repository
  • After some time CC founds this change and runs the script:
    • Get latest version from SVN
    • Run checks like Perl::Critic and Perl::Tidy
  • If any check failed then
    • Create detailed error report (which is available from web)
    • Send email notification if necessary

There are many good Continious Intergation system. I like Hudson.

小巷里的女流氓 2024-08-15 10:58:02

这是基于分支的开发可以发挥作用的另一个地方。本质上,您为您想要执行的每项任务创建一个新分支。分支免于质量检查,但合并到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.

咆哮 2024-08-15 10:58:02

如果您希望在钩子说“否”时提交失败,则提交必须等待钩子完成检查。

除了加快检查速度之外,我看不出你还能做什么。 (除了老口号:经常提交。那么你就不会一次提交这么多文件。)

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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文