使用 git svn 的不完整的 svn 提交历史记录



我们正在将一个 svn 分支迁移到 git。

我们未能在 git repo 中从 svn 获取完整的提交历史记录,需要帮助才能正确获取完整的历史记录。

git svn 克隆对我们不起作用,因为它一直失败

"警告:有太多无法触及的松散物体;运行'git prune'来删除它们。

我们的仓库有大约 r250000 次提交

我们在 https://abc.xyz.com/svn/app1 有一个存储库根 URL

我们有包含文件夹的分支 A(网址:https://abc.xyz.com/svn/app1/proj1/A/trunk)

卫生纸

来源

日文

我们创建了分支 B(从分支 A 在 r12000)包含文件夹(网址:https://abc.xyz.com/svn/app1/path/to/proj2/B/trunk)

卫生纸

来源

日文

我们想将 svn 分支 B 迁移到 git 作为我们在 git 中的主干

我们使用非标准SVN布局

我们使用 git-svn 版本 2.18.0 (svn 1.7.14)

我们不使用 svn2git

我们做错了什么?

第一次运行

我们试过了

cd svngitTrunkrepo
git config gc.pruneExpire now
git config gc.auto 1
git svn init  https://abc.xyz.com/svn/app1 -T path/to/proj2/B/trunk --prefix svn/ svngitTrunkrepo
git svn fetch
error: invalid object 100644 xxxyyyzzz111222333444555666 for 'src/to/file.java'
fatal: git-write-tree: error building trees
write-tree: command returned error: 128

第二次运行

我们试过了

cd svngitTrunkrepo2
git config gc.pruneExpire now
git config gc.worktreePruneExpire now
git config gc.reflogExpire now
git config gc.reflogExpireUnreachable now
git config gc.auto 1
git svn init https://abc.xyz.com/svn/app1 -T path/to/proj2/B/trunk --prefix svn/ svngitTrunkrepo2
git svn fetch -r 1:50000
git gc --aggressive
git svn fetch -r 50000:66813
git gc --aggressive
git svn fetch -r 66813:76813
git gc --aggressive
(continue)
git svn fetch -r 216813:220000
git gc --aggressive

运行的输出显示

(continue)
r218237 = b9e6e8ee272fdaa2611f6c3e9ccc05d412ecdf48 (refs/remotes/svn/trunk@218238)
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
Found branch parent: (refs/remotes/svn/trunk) b9e6e8ee272fdaa2611f6c3e9ccc05d412ecdf48
Following parent with do_switch
Successfully followed parent
r218239 = d4af17ac206cb4650f1aa0490dfdb4e1c00a5c16 (refs/remotes/svn/trunk)
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
Checking out files: 100% (63293/63293), done.
Checked out HEAD:
https://abc.xyz.com/svn/app1/path/to/proj2/B/trunk r218239
fatal: gc is already running on machine 'ppplwxzdw' pid 21345 (use --force if not)

然后我们检查提交历史记录

svngitTrunkrepo2]# git log -v

但我们只看到了29个修订版,而不是预期的198312修订版。

消息

fatal: gc is already running on machine 'slc15zdw' pid 21345 (use --force if not)

指示git gc正在尝试启动两次。同时,你对git gc设置非常奇怪——特别是git config gc.auto 1这意味着对于每个松散的对象,git gc都会尝试启动。这很符合上述fatal信息。

尝试在没有任何gc.*参数的情况下运行git svn- 我认为它们弊大于利。

最新更新