在正常开发过程中,从VCS永久删除版本是否有意义? [英] Does it make sense to permanently delete versions from a VCS as part of a normal development process?

查看:54
本文介绍了在正常开发过程中,从VCS永久删除版本是否有意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在工作场所使用ClearCase。将代码合并到主分支之后,我们的标准流程的一部分是完全消除开发和集成分支上的所有版本。因为这会抹去这些版本附带的所有签入注释,所以我们的源文件必须有一个冗长的序言注释,以标识每个更改。



我有几次指出,这否定了使用 版本控制系统的根本原因之一,并指出通过删除版本,当问题出现时,就不可能看到谁最初从事某项工作,等等。签入新版本的人已经学会了不打扰输入签入注释,因为无论如何它都会被删除。



我听说要删除签入的理由旧版本通常只是归结为感觉良好的原因。我经验丰富的同事觉得删除这些旧分支会使文件的版本树更干净。他们声称,一旦将这些旧版本合并到我们的后备箱中,便没有理由保留这些旧版本。他们还担心其他开发人员会意外地将这些过时的分支保留在其查看配置规范中。最后,他们认为删除这些分支可以节省CM服务器上的磁盘空间。



我是否对此感到不好,或者是否还有其他开发商店?谁以这种方式成功运作?如果您还认为这是一个坏主意,您还会提出其他哪些主张保留旧版本的论点?如果您已经成功地通过这种方法进行操作,那么您观察到了哪些好处?






编辑后进行了澄清:上一页始终保留主干版本。原来是创建或修改东西的是分支。

解决方案

您已经注意到一个大问题:删除提交注释后,就不会自动记录代码的状态。也没有办法检查软件的运行方式的历史:这是一个很大的问题,带有大量的序言注释,可能准确也可能不准确。



通常,当我遇到看起来很奇怪的代码时,我想知道它是如何实现的。由于我们使用Subversion,因此我可以使用 svn blame查找该行出现的版本,然后从那里进行检查。这通常会导致理解代码的目的,并提供一个线索,告诉我通过更改它可能会破坏什么。



虽然这可能节省一些空间,但是一个好的VCS会存储增量,因此不会占用全部空间,这通常也很有用。



那么多的额外空间(注意:我不知道ClearCase是否以这种方式很好)。同时,您正在使用的文件会被序言注释以及可能被注释掉或有条件地编译的代码膨胀,以防以后使用。



作为曾经管理VCS系统的人,只有两个理由将某些内容从系统中删除。一个是如果某个东西不应该提交而导致问题(例如,它可能非常大-有些人在不仅提交源文件而且还提交所有二进制文件时遇到了问题),另一个是这是不适当的(例如机密信息)。


We use ClearCase at my workplace. Part of our standard process when code is merged to the main (trunk) branch is to completely eradicate all of the versions on development and integration branches. Because this wipes out all of the check-in comments that went along with these versions, our source files have to have a lengthy prologue comment that identifies each change.

On a few occasions I have pointed out that this negates one of the fundamental reasons for using a version control system, and stated that by removing versions it becomes impossible to see who originally worked on something, when problems got introduced, etc. People checking in new versions have learned not to bother entering a check-in comment because it's just going to be deleted anyway.

The justification I have heard for removing the old versions has usually just come down to "feel-good" reasons. My more experienced coworkers feel that removing these old branches makes the version trees for files "cleaner". They claim that there is no reason to keep these old versions around once it's been merged to our trunk. They're also concerned that other developers will accidentally keep these outdated branches in their view config specs. Finally, they argue that removing these branches saves disk space on the CM server.

Am I right to have a bad feeling about this, or are there other development shops out there who operate successfully in this way? If you also think this is a bad idea, what other arguments in favor of keeping old versions would you supply? If you have operated successfully with this kind of process, what sort of benefits have you observed?


Edited to clarify: Previous versions of the trunk are always preserved. It's the branches where the stuff originally got created or modified that are removed.

解决方案

You've already noticed one big problem: with the removal of commit comments, there's no automatic record of how the code got to be the way it is. There's also no way to examine the history of how the software got to be the way it was: it's one big lump, with large prologue comments that may or may not be accurate.

Frequently when I come across code that looks odd, I want to know how it came to be. Since we use Subversion, I can use "svn blame" to find what revision the line appeared in, and check it from there. This will usually lead to understanding the purpose of the code, and give me a clue what I might break by changing it. It's also often useful to find when a feature was added or removed.

While this may save some space, a good VCS will store deltas and therefore won't take up all that much extra space (note: I don't know if ClearCase is good in this way). In the meantime, the files you're using are swollen by the prologue comments and likely by code that's commented out or conditionally compiled in case it's going to be useful later on.

As somebody who used to administer a VCS system, there's only two reasons to delete something out of the system. One is if something got committed that shouldn't be, and is causing problems (it may be very large, for example - some people have had problems when somebody committed not only the source files but all the binaries), and the other is if it's inappropriate (such as confidential information).

这篇关于在正常开发过程中,从VCS永久删除版本是否有意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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