获取最后一条消息或最后一次 CVS 提交的差异

发布于 2024-08-07 03:49:28 字数 31 浏览 6 评论 0原文

我想知道如何轻松获取 CVS 模块中的最后更改。

I am wondering how to get the last changes in a CVS module easily.

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

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

发布评论

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

评论(3

给不了的爱 2024-08-14 03:49:28

我想也许你可以使用历史命令。尝试类似的操作:

cvs history -c -D 2012-04-01 -a

上面的示例显示了自指定日期以来的所有提交(指定后列表的长度有限......)。

-c 表示提交,
-a 表示所有用户。

具有相同时间戳和用户的提交显然来自同一提交。然后,您可以继续读取该提交的日志消息,

cvs log -r <version> <file>

只需从特定提交中选择一个文件。您还可以在历史输出中找到该文件的版本。最后,要查看差异,我将使用

cvs diff -D "<date 1>" -D "<date 2>"

此处,“日期 1”和“日期 2”应该是提交之前和之后的时间戳。请注意(据我所知),如果您在分支上工作(??),这似乎不起作用。我想这将是另一个问题的主题。

I think perhaps you could use the history command. Try something like:

cvs history -c -D 2012-04-01 -a

The above example shows all commits since the date specified (specified so the list is limited in length...).

-c means commits,
-a means all users.

Commits with the same timestamp and user are then obviously from the same commit. You can then proceed to read the log message of that commit with

cvs log -r <version> <file>

Just select one of the files from the specific commit. You find the version of that file in the history output as well. Finally, to see the diff I would use

cvs diff -D "<date 1>" -D "<date 2>"

Here, "date 1" and "date 2" should be a timestamp just before and just after the commit. Note that (as far as I am aware), this does not seem to work if you are working on a branch (??). That would be the topic for another question I suppose.

败给现实 2024-08-14 03:49:28

cvs log 将返回所有这些。由于您不能说“最后 N 个修订”(在这里,我什至不能说 cvs log HEAD),因此有两个选项:

  1. 使用 head -N code> 获取最上面的 N 行(仅限 Unix 或 Cygwin)

  2. 使用日期和 cvs log -d DATE

cvs log will return all of them. Since you can't say "the last N revisions" (here, I can't even say cvs log HEAD), there are two options:

  1. Use head -N the get the N topmost lines (Unix or Cygwin only)

  2. Use a date and cvs log -d DATE

未蓝澄海的烟 2024-08-14 03:49:28

由于 CVS 实现单独对每个文件进行版本控制,我想您必须遍历每个文件并比较提交时间戳以确定哪个文件是最新的。结合这一点,CVS 不支持提交集的概念,因此您可以获得一堆具有相同提交时间戳的文件。那么哪一个是最新的呢?或者,也许您可​​以创建一个写入日志文件的提交挂钩,并使用它来确定最新的提交。

正如您可能已经想到的,这两条路都不是特别适合选择的道路。我强烈建议您在模块级别始终与标签进行比较。建立一个软件流程,包括在进行足够重要的改进时对模块进行标记(例如每日构建、部署到测试环境等),然后使用创建的标记作为比较基线。

完成对标记的最新更改的比较。

  • 您可以通过在没有工作副本的情况下使用 cvs rdiff 命令或
  • 在工作副本顶层使用 cvs diff 命令来

请参阅 CVS完整参考文档。

Since the CVS implementation versions each file individually, I suppose you'd have to through each file and compare the commit timestamps to determine which one is the latest. Combine this with the fact that CVS does not support the concept of a commit set, so you can get a bunch of files with equal commit timestamp. So which one is the latest? Or maybe you could create a commit hook that writes to a log file and use that to determine the latest commit.

As you probably figured out, neither of these is a particularly giving path to choose. I strongly suggest that at the module-level you always compare against tags. Establish a software process that includes tagging the module when an important enough improvement is made (e.g. daily build, deployment to test environment, etc..) and then use the created tag as the comparison baseline.

You can accomplish diffing the latest changes against a tag by using

  • cvs rdiff command without a working copy, or
  • cvs diff command at the top-level of a working copy

See the CVS documentation for complete reference.

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