在 svn 中防止同行评审之前提交
有没有用于同行评审的 svn hook?我想确保任何开发人员在得到同行评审之前都无法提交代码。 svn 如何强制执行此操作?
Is there any svn hook for peer review? I would like to make sure that any developer could not commit code until it gets reviewed by a peer. How can this be enforced by svn?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在这里感觉到一个误解:如果您尝试将代码审查添加为预签入步骤,那么您将源代码存储库视为完美、理想代码的权威,但将不完美的代码排除在外。这不利于源存储库的整体实用性。代码应尽可能早地存储在存储库中。存储库中的代码是可跟踪更改的、易于访问、更易于审查且更易于备份。
因此,走简单的路线:将代码存储在分支中(可能是一个额外的
unreviewed
文件夹,与branches
和tags
一起),并在分支发布之前对其进行审查合并到其目标分支。技术方面变得更容易,并且您不需要预提交挂钩。I sense a misunderstanding here: If you are trying to add code review as a pre-check-in step, you are treating your source repository as the authority for perfect, ideal code, but keep imperfect code out of it. This is detrimental to the overall usefulness of a source repository. Code should be in the repository as early as practically possible. Code in the repository is change-tracked, easily accessible, easier to review and easier to backup.
So, go the easy route: Store code in branches (maybe an extra
unreviewed
folder alongsidebranches
andtags
) and review the branch before it gets merged into its target branch. The technical side gets easier, and you have no need for pre-commit hooks.您需要的是一个与 svn 配合使用的代码审查工具。请参阅此处获取一些建议:什么是使用 Subversion (SVN) 进行代码审查的最佳方式? [关闭]
另请参阅 Quora 上的这个非常相似的问题,其中有一些很好的答案:最好的代码审查工具是什么?
What you need is a code review tool that works with svn. See here for some suggestions: What's the best way to do a code review with Subversion (SVN)? [closed]
Also see this very similar question on Quora which has some good answers: What are the best code review tools?