源文件上的历史日志和文件 ID 等版本控制信息有用吗?

发布于 2024-09-30 21:17:54 字数 263 浏览 0 评论 0原文

我知道它们提供了快速参考,但随着代码的增长,它们可能会导致数百个文件因版本/历史记录更新而发生更改。

这导致/涉及我的另一个问题: 有没有办法防止代码注释被标记为从版本控制获得的差异中的更改? (CVS/SVN)

I know that they provide a quick reference, but as the code grows they can lead to hundreds of files changing just due to version/history updates.

This leads/relates to my other question:
Is there a way to prevent code comments to be marked as changes in the diffs obtained from version control? (CVS/SVN)

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

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

发布评论

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

评论(2

放手` 2024-10-07 21:17:54

将版本/历史信息保留在版本控制中。这就是它所擅长的。

源文件中的版本/历史信息仅对那些无法访问版本控制存储库而阅读源代码的人有用。为了证明您的团队需要付出努力来维护这些笔记,这种情况的可能性有多大以及有多重要?我个人的观点是,这会为附带福利增加很多额外的工作。

Keep the version/history info in the version control. That's what it's good at.

Version/history info in the source file is only useful for people that read the source code without having access to your version control repository. How likely and how important is that scenario, to justify the effort you will require from your team to maintain these notes? My personal opinion is that this would add a lot of additional work for fringe benefits.

泪眸﹌ 2024-10-07 21:17:54

我同意@Franci Penov 的观点。这里有一个稍微不同的观点:

  • 最好的情况中,它们是无用的,因为它们只是复制现成的信息,总是自动更新,并且在版本控制系统中更容易访问。
  • 在所有其他情况下,它们的范围从分散注意力到烦人到彻底误导(如果它们与版本控制系统不同步)。

I agree with @Franci Penov. Here's a slightly different perspective:

  • In the best case, they are useless, because they just duplicate information that is readily available, always automatically up-to-date, and much easier accessible in the version control system.
  • In all other cases, they range from distracting over annoying to outright misleading (if they go out of sync with the version control system).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文