git svn rebase:不完整的数据:Delta源意外结束

时间:2021-02-13 22:50:10

I have been maintaining the git mirror of the watir project. Some time a couple weeks ago, we had someone ready to submit their first git-based patch. Unfortunately, we ran into some issues regarding line endings (CRLF vs. LF, etc.) because of the multi-platform nature of the project.

我一直在维护watir项目的git镜像。几周前的某个时候,我们有人准备提交他们的第一个基于git的补丁。不幸的是,由于项目的多平台性质,我们遇到了关于线路结尾(CRLF与LF等)的一些问题。

I tried what I could to set the autocrlf option (to 'input'), and do some --hard resets. However, a few days later, the daily update (git svn rebase) is spewing this error:

我尽我所能设置autocrlf选项('输入'),然后做一些--hard重置。但是,几天后,每日更新(git svn rebase)会出现此错误:

Incomplete data: Delta source ended unexpectedly

I've tried googling around for what to do, but even removing the autocrlf setting in the .git/config hasn't helped. I fear the working copy is corrupt, but I hope it is not unrecoverable.

我已经尝试使用谷歌搜索该怎么做,但即使删除.git / config中的autocrlf设置也无济于事。我担心工作副本是腐败的,但我希望它不是不可恢复的。

Obviously, a possible course of action is to just re-import from svn and start a fresh mirror, but I hope we don't have to do that, since the current watir-mirror has already been forked, and people have developed new code in their forks.

显然,一个可能的行动方案是从svn重新导入并开始一个新的镜像,但我希望我们不必那样做,因为当前的watir-mirror已经分叉了,人们开发了新的代码在他们的叉子里。

Thanks in advance for any help.

在此先感谢您的帮助。

5 个解决方案

#1


16  

I had this same problem in trying to create a git repository from the brlcad svn repository. I solved it by doing git svn reset --r XXXXX, where I set XXXXX to be about 50 revisions prior to the one that originally produced the error.

我在尝试从brlcad svn存储库创建git存储库时遇到了同样的问题。我通过执行git svn reset --r XXXXX解决了这个问题,我将XXXXX设置为最初产生错误的版本之前的50个版本。

Stepping back a single revision was not successful in resolving the error. As part of the process, I received errors from git about HEAD not being defined. To resolve this, I did a git svn find-rev XXXXX to determine the hash corresponding to the revision I wanted, then git checkout. After this, the errors about HEAD were gone and the git svn reset -r XXXXX worked.

退回单个修订版并未成功解决错误。作为整个过程的一部分,我从git收到有关未定义HEAD的错误。为了解决这个问题,我做了一个git svn find-rev XXXXX来确定对应于我想要的修订版的哈希值,然后是git checkout。在此之后,关于HEAD的错误消失了,git svn reset -r XXXXX工作了。

#2


5  

From personal experience, git-svn always generates the exact same commits when cloning or fetching from a svn repository with the same parameters (try it: create a dummy repository, clone it with git-svn, do some more commits, clone it again, and fetch on the first copy; the resulting commits should have the exact same hash).

根据个人经验,当从具有相同参数的svn存储库进行克隆或获取时,git-svn始终生成完全相同的提交(尝试:创建虚拟存储库,使用git-svn克隆它,再做一些提交,再次克隆它,并获取第一个副本;结果提交应该具有完全相同的哈希)。

This gives you an interesting option: you can start a separate fresh mirror with the same parameters, and compare both to see where they diverge (or it they diverge at all; be sure to compare the hashes, since they are what matters). If they are the same (or you decide the commits after they diverge don't matter), you can use the fresh mirror without breaking the forks (or breaking less of them, if you decided to ignore a few diverging commits).

这给了你一个有趣的选择:你可以用相同的参数开始一个单独的新镜像,并比较它们以查看它们的分歧(或者它们根本不同;确保比较哈希,因为它们是重要的)。如果它们是相同的(或者你决定它们发散后的提交无关紧要),你可以使用新镜像而不会破坏分支(如果你决定忽略一些不同的提交,则可以减少它们的数量)。

#3


4  

I had the same problem with git svn fetch, but the reset approach didn't work for me, perhaps because I don't really know when the corruption occurred. Here's what finally worked for me. I did a git svn fetch --ignore-paths="/branches/" which ran without error. After that, I once again did my git svn fetch, and this time worked.

我对git svn fetch有同样的问题,但重置方法对我不起作用,也许是因为我真的不知道腐败发生的时间。这是最终对我有用的东西。我做了一个git svn fetch --ignore-paths =“/ branches /”,它运行没有错误。在那之后,我又一次做了我的git svn fetch,这一次起作用了。

#4


0  

i had the same problem and like Todd's case, going to a previous revision fixed the problem.

我有同样的问题,像托德的情况一样,进入以前的修订版修复了问题。

I think the solution is to go to two steps previous revision of the problematic file.

我认为解决方案是转到有问题的文件的前两个版本。

#5


0  

I've seen a similar problem. It occurs when I do a partial clone of an svn repo. I'm guess git-svn can't find the original source of the file when doing a dcommit. I've fixed it by ensuring I'm completely up to date (git svn rebase) then using git svn set-tree to commit specific changes to subversion. If you have a lot of changes to commit, this can be a pain since you need to manually commit each change in order but it works well if you only have one or two commits to push.

我见过类似的问题。当我对svn repo进行部分克隆时会发生这种情况。我猜git-svn在做dcommit时找不到文件的原始来源。我通过确保我完全更新(git svn rebase)然后使用git svn set-tree来提交对subversion的特定更改来修复它。如果你有很多提交的更改,这可能会很麻烦,因为你需要按顺序手动提交每个更改,但如果你只有一个或两个提交推送,它会很好。

#1


16  

I had this same problem in trying to create a git repository from the brlcad svn repository. I solved it by doing git svn reset --r XXXXX, where I set XXXXX to be about 50 revisions prior to the one that originally produced the error.

我在尝试从brlcad svn存储库创建git存储库时遇到了同样的问题。我通过执行git svn reset --r XXXXX解决了这个问题,我将XXXXX设置为最初产生错误的版本之前的50个版本。

Stepping back a single revision was not successful in resolving the error. As part of the process, I received errors from git about HEAD not being defined. To resolve this, I did a git svn find-rev XXXXX to determine the hash corresponding to the revision I wanted, then git checkout. After this, the errors about HEAD were gone and the git svn reset -r XXXXX worked.

退回单个修订版并未成功解决错误。作为整个过程的一部分,我从git收到有关未定义HEAD的错误。为了解决这个问题,我做了一个git svn find-rev XXXXX来确定对应于我想要的修订版的哈希值,然后是git checkout。在此之后,关于HEAD的错误消失了,git svn reset -r XXXXX工作了。

#2


5  

From personal experience, git-svn always generates the exact same commits when cloning or fetching from a svn repository with the same parameters (try it: create a dummy repository, clone it with git-svn, do some more commits, clone it again, and fetch on the first copy; the resulting commits should have the exact same hash).

根据个人经验,当从具有相同参数的svn存储库进行克隆或获取时,git-svn始终生成完全相同的提交(尝试:创建虚拟存储库,使用git-svn克隆它,再做一些提交,再次克隆它,并获取第一个副本;结果提交应该具有完全相同的哈希)。

This gives you an interesting option: you can start a separate fresh mirror with the same parameters, and compare both to see where they diverge (or it they diverge at all; be sure to compare the hashes, since they are what matters). If they are the same (or you decide the commits after they diverge don't matter), you can use the fresh mirror without breaking the forks (or breaking less of them, if you decided to ignore a few diverging commits).

这给了你一个有趣的选择:你可以用相同的参数开始一个单独的新镜像,并比较它们以查看它们的分歧(或者它们根本不同;确保比较哈希,因为它们是重要的)。如果它们是相同的(或者你决定它们发散后的提交无关紧要),你可以使用新镜像而不会破坏分支(如果你决定忽略一些不同的提交,则可以减少它们的数量)。

#3


4  

I had the same problem with git svn fetch, but the reset approach didn't work for me, perhaps because I don't really know when the corruption occurred. Here's what finally worked for me. I did a git svn fetch --ignore-paths="/branches/" which ran without error. After that, I once again did my git svn fetch, and this time worked.

我对git svn fetch有同样的问题,但重置方法对我不起作用,也许是因为我真的不知道腐败发生的时间。这是最终对我有用的东西。我做了一个git svn fetch --ignore-paths =“/ branches /”,它运行没有错误。在那之后,我又一次做了我的git svn fetch,这一次起作用了。

#4


0  

i had the same problem and like Todd's case, going to a previous revision fixed the problem.

我有同样的问题,像托德的情况一样,进入以前的修订版修复了问题。

I think the solution is to go to two steps previous revision of the problematic file.

我认为解决方案是转到有问题的文件的前两个版本。

#5


0  

I've seen a similar problem. It occurs when I do a partial clone of an svn repo. I'm guess git-svn can't find the original source of the file when doing a dcommit. I've fixed it by ensuring I'm completely up to date (git svn rebase) then using git svn set-tree to commit specific changes to subversion. If you have a lot of changes to commit, this can be a pain since you need to manually commit each change in order but it works well if you only have one or two commits to push.

我见过类似的问题。当我对svn repo进行部分克隆时会发生这种情况。我猜git-svn在做dcommit时找不到文件的原始来源。我通过确保我完全更新(git svn rebase)然后使用git svn set-tree来提交对subversion的特定更改来修复它。如果你有很多提交的更改,这可能会很麻烦,因为你需要按顺序手动提交每个更改,但如果你只有一个或两个提交推送,它会很好。