简体   繁体   English

cvs2git 在将 CVS 迁移到 Git 时创建了一些额外的提交

[英]cvs2git was creating some extra commits while migrating CVS to Git

The following commit message showing while migrating from CVS to Gitlab using cvs2git (Python 2.7.5).使用 cvs2git (Python 2.7.5) 从 CVS 迁移到 Gitlab 时显示以下提交消息。 While migrating I noticed that cvs2svn was creating some extra commits with same following message that seem to be unnecessary.在迁移时,我注意到 cvs2svn 正在创建一些额外的提交,并带有相同的以下消息,这似乎是不必要的。

Why its creating unwanted commits during migration?为什么它会在迁移期间创建不需要的提交?

  This commit was manufactured by cvs2svn to create branch 'BRANCH_DEV_2014'.

CVS allows you to tag/branch some subset of all files. CVS 允许您标记/分支所有文件的某些子集。 Or tag/branch different versions of files that existed at different times.或标记/分支在不同时间存在的不同版本的文件。 (You could in theory create a tag that only tagged half of your files and of those, 1/3 could have been the versions from 2003 and the other 2/3 the versions from 2019.) (理论上,您可以创建一个仅标记一半文件的标签,其中 1/3 可能是 2003 年的版本,另外 2/3 可能是 2019 年的版本。)

This can be intentional, or unintentional just because CVS is a bit messy that way.这可能是有意的,也可能是无意的,因为 CVS 那样有点混乱。

Git, on the other hand, enforces that all tags/branches are created on a specific consistent state of the repository from a single point in time.另一方面,Git 强制要求所有标签/分支都是从单个时间点在存储库的特定一致 state 上创建的。

In the cvs2git process, when creating a tag/branch, if the tool cannot find any specific point in time and state of the whole repo that represents this new tag/branch, cvs2git will create a dummy commit to allow it to then tag/branch.在 cvs2git 进程中,当创建一个标签/分支时,如果该工具找不到任何特定的时间点和代表这个新标签/分支的整个 repo 的 state,cvs2git 将创建一个虚拟提交以允许它随后标记/分支.


Example:例子:

If you have two files in CVS, a.class and a_test.class and you have three commits to both of the如果您在 CVS 中有两个文件 a.class 和 a_test.class 并且您对这两个文件都有三个提交

  1. a.class a_test.class --- Initial version a.class a_test.class --- 初始版本
  2. a.class a_test.class --- Commit 2 a.class a_test.class --- 提交 2
  3. a.class a_test.class --- Commit 3 a.class a_test.class --- 提交 3

And then you created a tag v.1.0.0 based on Commit 2, except you only tagged a.class, you did not tag a_test.class.然后你基于 Commit 2 创建了一个标签v.1.0.0除了你只标记了 a.class,你没有标记 a_test.class。

When you convert this to git, git has no way to handle this, so it has to create a dummy commit.当您将其转换为 git 时,git 无法处理此问题,因此它必须创建一个虚拟提交。

o - Initial commit
|
o - Commit 2
|\ 
|  o - Dummy commit, removes a_test.class so there's just a.class. Tagged v.1.0.0
|
o - Commit 3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM