在真实的版本控制系统中跟踪文件名版本控制?

发布于 2024-12-08 01:53:16 字数 471 浏览 0 评论 0原文

是否有一种既定的方法来告诉 SCM(在我的例子中是 Mercurial),模式 foobaz_1_2_3.csv 的文件都应该被视为 foobaz.csv 的版本?

在我的应用程序中,我依赖于外部源的数据表,该数据表将版本号放在文件名中。最近,当我花了几天时间排除我这边的错误时,却发现这是因为他们更改了一些数据内容和所述更改的通知,因此跟踪各个版本之间的更改的重要性变得非常重要没有到达我。

如果文件名是不变的,Hg 会立即通知我内部变化,我可以在一两个小时内做出适当的反应,而且压力很小。我可以养成在签入之前将 foobaz_2_3_4 重命名为 foobaz 的习惯,或者运行 diff old new ,从现在起我可能会做其中一个或两个。

整个经历让我想知道是否有其他我没有想到的方法不会弄乱外部文件。 (例如,我有一个不使用 SCM 并依赖于我已丢弃的文件名+版本号的下游用户,那该怎么办?)

Is there an established method to tell the SCM, mercurial in my case, that files of the pattern foobaz_1_2_3.csv should all be considered versions of foobaz.csv ?

In my application I rely on data tables from an external source that put the version number in the filename. The importance of tracking changes across their versions was made painfully sharp recently when I spend days troubleshooting a bug on my side of the fence, only to discover it was because they changed some data content and notification of said change did not reach me.

If the filename was constant Hg would have informed me immediately of the internal change and I could have responded appropriately in an hour or two, with very little stress. I could just adopt the habit of renaming foobaz_2_3_4 to foobaz myself before checking in, or running diff old new and one or both of those is likely what I'll do from now on.

The whole experience has me wondering though if there might be other methods I've not thought of that don't mess with the external file. (for example what of I have a downstream user who doesn't use SCM and relies on the filename+version number, which I've thrown away?)

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

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

发布评论

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

评论(1

热鲨 2024-12-15 01:53:16

如果您在文件中获取的数据具有永久更改的名称和(可能)可更改的数据,您可以:

  • 在版本控制下存储数据文件(mercurial 可以)
  • 每次用新文件替换旧文件
  • hg addremove -s nnn(检查手册 hg help addremove)将检测可能的重命名并将文件包含在的历史记录中

If you get data in file with permanently changed name and (possibly) changeable data, you can:

  • Store data-file under version-control (mercurial is OK)
  • replace old file with new every time
  • hg addremove -s nnn (Check Manual hg help addremove) will detect possible rename and include new file in history of old
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文