通过 TortoiseSVN 提交时,如何强制我们的开发人员输入注释?
我经常看到大量的提交,但没有引用票据的注释......所以我最终返回并手动检查差异。不一定是坏事,但如果有笔记就更好了。有什么想法吗?
I often see a slew of commits, but no notes referencing the tickets... And so I end up going back and reviewing the diff manually. Not necessarily bad, but it would be nice to have notes. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
不是 TortoiseSVN,而是 Subversion 本身 - 服务器上的设置。您可以设置一个预提交挂钩来强制执行提交注释。如果您想更进一步,还有一些预提交挂钩可以验证是否存在对 Jira 等问题跟踪系统的引用。
Not TortoiseSVN, but Subversion itself - a setting on the server. You can set up a pre-commit hook that enforces a commit comment. There are also pre-commit hooks that will verify the presence of a reference to an issue tracking system like Jira if you want to go one step further.
您可以定义一个预提交挂钩脚本,该脚本会拒绝所有带有空或太短日志消息的提交。
这是帖子 关于如何去做。
You can define a pre-commit hook script which rejects all commits with an empty or too short log message.
Here is a post on how to do it.
您需要使用预提交挂钩,它是一种服务器设置,我为 VisualSVN 编写了一个挂钩,它基本上是一个批处理文件 - 类似的脚本可用于非基于 Windows 的 SVN 服务器。
You need to use a pre-commit hook which is a server setting, I have written one for VisualSVN which is basically a batch file -- similar scripts are available for non-windows based SVN Servers.
当然可以,但是您将如何强制执行非胡言乱语、有意义且上下文相关的提交消息?
当你发现蹩脚/空洞的提交时,最好直接打你不负责任的同事。或者相当于“拳击”的口头表达。只要确保他们感觉不好,这是应得的。
Sure, but how are you going to enforce non-gibberish, meaningful and contextualized commit messages?
Better to just punch your irresponsible coworkers when you notice a lame/empty commit. Or the verbal equivalent of punch. Just make sure they feel bad, it's deserved.
我使用了预提交挂钩脚本来确保提交注释始终引用问题跟踪系统中的问题号。例如,诸如此类的评论
将被接受,因为它包含错误号。即使采用这种安排,您仍然必须相信开发人员会插入有意义的注释和错误号。
I have used a pre-commit hook script to ensure that a commit comment always refers to an issue number in the issue tracking system. For example, a comment such as
would be accepted because it contains a bug number. Even with this arrangement, you still have to trust the developer to insert a meaningful comment and bug number.
我们的预提交钩子脚本(Windows 批处理):
Our pre-commit hookscript (windows batch):
您可以很容易地强制提交评论,但最终您将得到一百万个表示“调试”或“测试”的提交。
如果您的开发人员看不到添加提交消息的价值,则强制他们输入某些内容不会改变这一点。
更糟糕的是,当 Eclipse 用户集成了 SVN/CVS 以便记住他们最后的提交消息时,他们最终会提交一个与上一个任务/项目的消息完全不相关的文件。
You can force a commit comment easily enough, but what you'll end up with is a million commits that say "debugging" or "testing".
If your developers don't see the value in adding commit messages forcing them to type something is not going to change that.
What's worse is when Eclipse users have SVN/CVS integrated such that it remembers their last commit message - and they end up committing a completely unrelated file with the message from their last task/project.
TortoiseSVN 是一个客户端,您可能需要 在颠覆服务器上强制评论。
或者你可以告诉他们评论他们的提交。
TortoiseSVN is a client, you might want to force comments on the subversion server.
Or you can tell them to comment their commits.