是否可以强制提交 CVS 注释?
我想我真的在寻求帮助那些忘记的人的帮助,Cruise Control 向每个人发送提交的详细信息,因此人们热衷于添加有意义的评论,但有时会忘记。
I guess I'm really after an aid to help people who forget, Cruise Control sends out the details of commits to everyone, so people are keen to add a meaningful comment, but sometimes forget.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
不过,您还需要有人监控人们添加的评论。
或者当人们试图绕过你的检查时,会出现一系列“foo”、“checkin”、“commit”、“changed code”评论。
在过去的生活中,我们还强制提及缺陷/任务 ID,并检查任务跟踪系统中是否存在该 ID...
You will also want a human monitoring the comments that people are adding, though.
Or expect a flurry of "foo", "checkin", "commit", "changed code" comments as people try and bypass your check.
In a past life, we also enforced the mention of a defect/task ID, and checked that ID existed in the task tracking system...
您可以编写一个预提交挂钩来检查这。 这需要访问 CVS 服务器。
You can write a pre-commit hook that checks this. This requires access to the CVS server.
不要通过 CVS 强制执行注释,只需告诉开发人员您可能正在对注释进行抽查,因此请在签入代码时添加有用的注释。 虽然我同意代码本身中的注释更有用,但有时了解代码签入的目的是什么是有用的(例如修复了发票上四舍五入税额的错误)。 然而,这很容易被滥用,有人不断地检查评论,这会浪费大量时间。 这样,它就依赖于荣誉系统,并且没有人愿意因为没有输入您所要求的一行评论而被挑出来。
Rather than enforce comments through your CVS, just tell your developers that you may be doing spot checks on the comments, so please put in useful comments when you check in your code. While I agree that comments in the code itself are more useful, sometimes it is useful to know what the purpose of a code check-in was (e.g. fixed a bug in rounding tax amounts on invoices). However, this can be easily abused, with someone constantly checking the comments, which wastes a huge amount of time. This way it relies on the honor system, and the fact that no-one wants to be singled out for not putting in the one-line comment that you requested.
verifymsg 文件看起来像你想要的,尽管我自己从来没有尝试过。 如果提交注释不符合某些条件,则提交将中止。
The verifymsg file looks like what you want, although I've never tried it myself. If the commit comment doesn't match certain criteria, the commit is aborted.
我们使用 Subversion 和 Tortoise,可以做到这一点。
基本上,您需要在 trunk 文件夹上设置 tsvn:logminsize 参数。 这将允许您设置评论的最小长度(任何大于 1 的内容都将导致强制评论)
We use Subversion and Tortoise and it is possible to do this.
Basically you need to set the tsvn:logminsize parameter on the trunk folder. This will allow you to set a minimum length for a comment (anything > 1 will result in mandatory comments)