阻止签入 SVN

发布于 2024-08-28 06:26:29 字数 162 浏览 4 评论 0原文

我的团队使用 SVN 作为我们的软件平台,并且我们定期创建标签以帮助保持模块版本的一致性。据我了解,最佳实践是标签创建后不要修改。然而,有时似乎诱惑太大,对其中一个标签进行了修改。

有没有办法阻止这种类型的签到,或者至少让它们变得完全痛苦,以便我们可以自动阻止它们?

谢谢, 乔

My team uses SVN for our software platform, and we create tags periodically to help keep module versions straight. Best practice, as I understand it, is not to modify a tag once it has been created. However, it seems that sometimes the temptation is too great and a modification is made to one of the tags.

Is there a way to prevent these kinds of checkins, or at least make them a complete pain so that we can discourage them automatically?

Thanks,
Joe

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

烂人 2024-09-04 06:26:29

创建一个预提交挂钩,如果标签已存在,它将拒绝提交。有关实现挂钩的更多详细信息,请参阅此处(请参阅实现存储库挂钩部分):

http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html

Create a pre-commit hook which will reject the commit if the tag exists already. More details on implementing hooks can be found here (see the Implementing Repository Hooks section):

http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html

比忠 2024-09-04 06:26:29

我认为您正在尝试为非技术问题找到技术解决方案。在弄清楚如何处理这些签入之前,您必须先确定进行这些签入的原因。如果它们是在团队领导层批准的情况下制定的,那么任何流程都不会阻止它们将来发生。另一方面,如果这些检查是由自认为更了解的团队成员进行的,那么您就可以让领导层介入来解决流氓开发人员的问题。

只有在整个团队明确创建标签后的期望之后,您才能通过技术解决方案(如果需要)强制执行这些期望。

至于如何防止签入 - 在我看来,最简单的解决方案是创建标签后通过 基于路径的授权。但请注意,SVN 书籍的作者还明确声明了以下有关基于路径的授权:

但请注意,经常有
看不见的(和看得见的!)成本
与此功能相关。在
可见类别,服务器需要
做更多的工作来确保
用户有读或写的权限
每条具体路径;在某些方面
情况,有非常明显的
性能损失。在看不见的地方
类别,考虑您所在的文化
创造。大多数时候,虽然
某些用户不应该做出承诺
某些部分的更改
存储库,即社会契约
不需要技术上的
强制执行。

Methinks you are trying to find a technical solution for a non-technical problem. You have to identify why these checkins are made before figuring out how to deal with them. If they are made with the approval of the team leadership, no amount of process would prevent them from happening in the future. If on the other hand these checkins are made by individual team members who thought they know better - well, then you get the leadership involved to solve the problem of a rogue developer.

Only after the whole team is clear on what is expected once a tag is created, you can enforce these expectations with a technical solution (if needed).

As for how to prevent checkins - seems to me that the simplest solution would be once you've created the tag to set the security on it to read-only for everybody through the path-based authorization. Note however, that the authors of the SVN Book also explicitly state the following about the path-based authorization:

Note, though, that there are often
invisible (and visible!) costs
associated with this feature. In the
visible category, the server needs to
do a lot more work to ensure that the
user has the right to read or write
each specific path; in certain
situations, there's very noticeable
performance loss. In the invisible
category, consider the culture you're
creating. Most of the time, while
certain users shouldn't be committing
changes to certain parts of the
repository, that social contract
doesn't need to be technologically
enforced.

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