保留原始时间戳的版本控制系统? [英] Version Control System that keeps original timestamps?

查看:36
本文介绍了保留原始时间戳的版本控制系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题源于在集市提交/拉/等中保持原始时间戳有用吗?特别是来自这个答案.

理想情况下,当使用版本控制 (VC) 和bazaar(版本控制系统,VCS),可以:

  1. 在各种副本中保留文件内容的真实修改时间,因为这是关于文件的重要信息.无论 VC 下文件的具体内容如何,​​都是如此.
  2. 确保在获得修改后的副本(例如,bzr pull)后,根据 VC 下已更改的先决条件重新构建构建目标.由于 VCS 的典型用途:软件开发,这很重要.引用 维基百科:
    <块引用>

    对组织和控制修订的逻辑方式的需求几乎与写作一样存在……今天,最有能力(以及最复杂)的修订控制系统是那些用于软件开发的系统,…….

  3. 确保构建目标取决于在 VC 下更改的先决条件,在获得修改的副本后重新构建.这避免了处理时间可能出现的显着负担.(我认为放弃这一点没有其他不利之处).

是否有任何 VCS 可以同时实现这三点?

<小时>使用 bzr 目前的形式,不能得到三个.

可以得到 (1+2)使用原始时间戳,并对每个 pull 执行 make clean(或类似操作),从而重建所有目标而不是少数目标.另一方面,可以得到 (2+3)使用现在"作为时间戳.(1+3) 既不可能也不有趣.

bzr,考虑到软件开发,让(2+3)占上风,放弃第 1 点.

解决方案

这并没有回答具体的问题(是否有任何 VCS 可以同时实现这三个目标?),而是提出了一种实现方法.

  1. pull 以now"作为时间戳的修改过的文件(如 bzr 所做的那样),但也提取有关这些文件的真实修改时间的信息并存储.立>
  2. 强制重建.
  3. touch 使用已知真实修改时间修改的文件.

这将使本地副本处于理想状态.因此,一个可以以这种方式运行的软件将是一个解决方案.此外,动作 (2+3) 可以封装为增强型构建"动作.

This question stems from Is keeping original timestamp useful in bazaar commit/pull/etc.? and in particular from this answer.

Ideally, when using Version control (VC), with software like bazaar (Version control system, VCS), one would be able to:

  1. Keep the true modification time of files contents across the various copies, since this is an important piece of information about a file. This is true regardless of the specific contents of the files under VC.
  2. Make sure that build targets depending on changed prerequisites which are under VC, are rebuilt upon obtaining modified copies (e.g., bzr pull). This is important due to the typical use of VCSs: software development. Quoting from Wikipedia:

    The need for a logical way to organize and control revisions has existed for almost as long as writing has existed... Today, the most capable (as well as complex) revision control systems are those used in software development, ...

  3. Make sure that build targets not depending on changed prerequisites which are under VC, are not rebuilt upon obtaining modified copies. This avoids possibly significant overburden in processing time. (I see no other downside to forgoing this point).

Is there any VCS that achieves all three?


With bzr in its present form, one cannot get the three.

One could get (1+2) using the original timestamp, and doing make clean (or the like) with every pull, thus rebuilding all targets instead of only a few. On the other hand, one could get (2+3) using "now" as the timestamp. (1+3) is neither possible or interesting.

bzr, with software development in mind, lets (2+3) prevail, forgoing point 1.

解决方案

This does not answer the specific question (Is there any VCS that achieves all three?) but suggests a way of achieving it.

  1. pull modified files with "now" as timestamp (as bzr does), but also pull the information about true modification time of those files and store it.
  2. Force rebuilding.
  3. touch modified files with the known true modification times.

This will leave the local copy in ideal conditions. Thus, a piece of software that could operate this way would be a solution. Moreover, actions (2+3) could be encapsulated into an "enhanced build" action.

这篇关于保留原始时间戳的版本控制系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆