如何为 CVS 设置默认签入评论?

发布于 2024-07-17 01:00:28 字数 249 浏览 3 评论 0原文

如何为 cvs 生成默认注释? 我希望每个签入评论都以“Change #:”开头,并可供用户编辑。

我知道这可以在存储库中全局完成。 是否也可以在客户端以单个用户身份完成?

我正在使用命令行 cvs。

我们已经验证签入以“Change #:”开头,并且提供了有效的更改号码。 我想将签入注释默认为“Change #:”,以节省开发人员的打字时间。 如何在全球范围内做到这一点? 可以在本地/客户端完成吗?

How do I generate a default comment for cvs? I'd like every checkin comment to start with "Change #: " and be available for the user to edit.

I know this can be done globally in the repository. Can it also be done as a single user on the client side?

I am using command line cvs.

We already have verification that the checkin starts with "Change #: " and that a valid change number is provided. I'd like to default the checkin comment to "Change #: " to save developers some typing. How can this be done globally? Can it be done locally/client side?

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

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

发布评论

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

评论(2

惜醉颜 2024-07-24 01:00:28

要小心。 您还必须确保默认注释不会成为拐杖。 例如,您应该验证缺陷编号是否有效(例如当前打开以及实际存在)。 否则,程序员将简单地使用默认注释作为唯一注释。

在我看来,最好花精力验证评论而不是提供默认值。 告诉开发人员,除非评论满足要求,否则他们的更改将被拒绝 - 并记录预期(和接受)的内容。


提问者质疑“说得很好,但没有回答问题”。

很公平。 我并不真正使用 CVS,所以对接下来的内容持保留态度。

看看 Karl Fogel 的书“Open Source Development with CVS”(Coriolis,1999),我没有看到一个好的方法。 有“commitinfo”、“loginfo”和“verifymsg”文件,它们似乎都指定了验证日志消息的程序,并且当用户未指定“cvs ci -m”时启动编辑器为什么我提交了这个“”(或者,“cvs ci -F Why”表示文件中的消息),但就我个人而言,我总是在命令行上检查注释,并且不想启动编辑器为我。 因此,由于没有为 cvs 命令编写包装器(这将是相当复杂的),我在书中没有看到执行您请求的方法。

嗯...除非您使用在给定文件中创建默认消息的程序覆盖 cvs 的 shell 脚本包装器中用户对 CVSEDITOR 的定义,然后启动 ${VISUAL:-$ {编辑器:-vim}} 代替。 恶心,同样恶心! 但是,只要认真做,它就会起作用。 也许最困难的部分是确保程序员使用您的 cvs 脚本版本而不是二进制文件。

Be cautious. You must also ensure that the default comment does not become a crutch. For example, you should validate that the defect number is valid (currently open, for example, as well as actually exists). Otherwise, the programmers will simply use the default comment as the only comment.

In my view, it would be better to put the effort into validating the comment than into providing a default. Tell the developers that their changes will be rejected unless the comments meet the requirements - and document what is expected (and accepted).


The questioner challenges "nicely said, but does not answer the question".

Fair enough. I don't really use CVS, so take what follows with a pinch of salt.

Looking at Karl Fogel's book "Open Source Development with CVS" (Coriolis, 1999), I don't see a good way to do it. There are 'commitinfo', 'loginfo' and 'verifymsg' files that all seem to specify programs that validate log messages, and the editor is launched when the user doesn't specify 'cvs ci -m"Why I committed this"' (or, 'cvs ci -F why' for a message in a file), but personally I always checkin with comments on the command line and would hate to have an editor launched for me. So, short of writing a wrapper for the cvs command (which would be moderately complex), I don't see a way in the book of doing what you request.

Hmmm...unless you override the user's definition of CVSEDITOR in a shell script wrapper for cvs with a program that creates the default message in the given file and then launches ${VISUAL:-${EDITOR:-vim}} instead. Ick, and likewise yuck! But, done carefully, it would work. Probably the hardest part is ensuring that the programmers use your script version of cvs instead of the binary.

故事还在继续 2024-07-24 01:00:28

您可以使用 rcsinfo 文件指定用于签入的模板。

请参阅此 页面 了解详细信息。

这是在服务器端完成的,因此您需要在服务器上放置模板文件。

此外,如上所述,您可以在 CVS 命令行上使用您自己的签入注释覆盖模板。

You can use the rcsinfo file to specify a template to use for the check in.

See this page for details.

This is done server side, so you need your template files on your server.

Also, as noted above, you can override the template with your own check in comments on the CVS command line.

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