Git svn rebase:校验和不匹配

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3156744/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 04:22:35  来源:igfitidea点击:

Git svn rebase : checksum mismatch

svngitgit-svn

提问by darkpotpot

I have a problem when I try to do a git svn rebase on my repository. It displays :

当我尝试在我的存储库上执行 git svn rebase 时遇到问题。它显示:

Checksum mismatch: code/app/meta_appli/app_info.py
expected: d9cefed5d1a630273aa3742f7f414c83
     got: 4eb5f3506698bdcb64347b5237ada19f

I searched a lot but haven't found a way to solve this problem.

我搜索了很多,但还没有找到解决这个问题的方法。

If anybody knows, please share your knowledge. Thanks in advance.

如果有人知道,请分享您的知识。提前致谢。

回答by Domenic

This solutionwas the only one that worked for me:

此解决方案是唯一对我有用的解决方案

See what was the revision number of the last change on the file:

git svn log chrome/test/functional/search_engines.py

Reset svn to be closest parent before that revision:

git svn reset -r62248 -p

Do a git svn fetch!

Dance at your success.

查看文件上次更改的修订号是多少:

git svn log chrome/test/functional/search_engines.py

在该修订之前将 svn 重置为最接近的父级:

git svn reset -r62248 -p

做一个git svn fetch

为你的成功而舞。

回答by ollupac

Just happened to me, I run out of space in the middle of a "git svn dcommit" and after that I was getting the same message, "Checksum mismatch".

刚好发生在我身上,我在“git svn dcommit”中间用完了空间,之后我收到了同样的消息,“校验和不匹配”。

I just edited .git/refs/remotes/git-svn and replaced the id of the problematic commit with the previous one. Next rebase fixes the problem.

我刚刚编辑了 .git/refs/remotes/git-svn 并用前一个替换了有问题的提交的 ID。下一个 rebase 修复了这个问题。

回答by FooF

I encountered this error when I just specified branches but no trunk. When I specified one of the branches as trunk, there was no error any more when I retried. (The whole "trunk", "branch", "trunk" distinction is generally speaking a bit silly to enforce in git svnas they are just human conventions without any deeper technical meaning behind them in svn.)

当我只指定分支但没有主干时,我遇到了这个错误。当我将其中一个分支指定为主干时,重试时不再出现错误。(整个“主干”、“分支”、“主干”的区别一般来说执行起来有点傻,git svn因为它们只是人类的约定,在它们背后没有任何更深层次的技术含义svn。)

回答by Guillaume Outters

Additionnally to Domenic's answer (still svn-to-gitting in 2019…):

除了多梅尼克的回答(2019 年仍然是 svn-to-gitting ......):

In the specific case of a deleted-then-recreated branch (1), reset should be applied to the branch creation commit, after having deleted references to the old branch:

在删除然后重新创建的分支 (1) 的特定情况下,在删除对旧分支的引用后,应将重置应用于分支创建提交:

> git svn fetch
…
r146970 = …
Checksum mismatch: bla.x # Uh oh, there we go!
> # Seems to have occurred while fetching r146971 (last passed rev + 1), so let's try it:
> svn log -v -r 146971 $svn
M /branches/y/bla.x
> # OK, bla.x is a good indicator that this is indeed our failing commit.
> # What was the preceding commit on it, according to SVN?
> svn log -v -r 146971 $svn/branches/y/bla.x | less
------------------------------------------------------------------------
r146971
  M /branches/y/bla.x
Modified bla.x
------------------------------------------------------------------------
r145665
  A /branches/y (from /branches/z:145664)
Rebasing y on z
------------------------------------------------------------------------
> # Exactly what we were looking for: a branch creation. Let us clean branch y
> # so that git-svn is forced to find its recreation commit:
> rm -R .git/refs/remotes/origin/y .git/*/refs/remotes/origin/y
> vi .git/info/refs .git/packed-refs # remove references to y
> git svn reset -r145665 -p
> git svn fetch

I'm supposing that git-svn did not see or apply the branch deletion, thought it was unnecessary to recreate it from branch z, and thus tried to applied 146971 on the old tree. Telling it there is no branch y forces it to play the branch creation (from z).

我假设 git-svn 没有看到或应用分支删除,认为没有必要从分支 z 重新创建它,因此尝试在老树上应用 146971。告诉它没有分支 y 会强制它播放分支创建(来自 z)。

(1) mimicking in svn the equivalent of a git rebase z of branch y: svn mv y y.old && svn cp z y && svn merges to get all commits of y.old on the new y

(1) 在 svn 中模仿分支 y 的 git rebase z 等价物: svn mv y y.old && svn cp zy && svn merges 以获取 y.old 在新 y 上的所有提交

回答by unhammer

I just did a git gcand then git svn rebaseworked again.

我只是做了一个git gc然后又git svn rebase工作了。

回答by Rusi Popov

In our practice the error "Checksum mismatch:" on .shtml files in git svn clone ... command was caused by the setup of the front-end Apache server to interpret the.shtml files (from SVN) as Server-Side Includes (SSI) and thus produce live content instead of just providing the stored file content. Disabling SSI in Apache's /etc/httpd.conf file for the period of migration by commenting out the

在我们的实践中,git svn clone ... 命令中 .shtml 文件上的错误“校验和不匹配:”是由前端 Apache 服务器的设置引起的,以将 .shtml 文件(来自 SVN)解释为服务器端包含( SSI),从而产生实时内容,而不仅仅是提供存储的文件内容。通过注释掉迁移期间在 Apache 的 /etc/httpd.conf 文件中禁用 SSI

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

directives solved the problem.
Anyway, the migration of the repository could exclude some paths and files happens with:

指令解决了这个问题。
无论如何,存储库的迁移可能会排除一些路径和文件发生在:

git svn clone <URL> --ignore-paths=<regex>

clause. It makes sense to check the environment of the SVN server process if those files have special interpretation like SSI (and the .php and .py files) and disable it.

条款。如果这些文件具有特殊解释,如 SSI(以及 .php 和 .py 文件)并禁用它,则检查 SVN 服务器进程的环境是有意义的。