How can I recover after a checksum mismatch using git svn clone '?

I am cloning an SVN repository in git as part of our migration plan. I hit various snags along the way, forcing me to continue to clone with the git svn fetch . The most recent failure I cannot figure out how to solve:

 $ git svn fetch Checksum mismatch: dc/trunk-4632-jh/dc-smtpd/lib/Qpsmtpd/Address.pm.t 8ce3aea3f47dc115e8fe53bd62d0f074cfe93ec6 expected: 59de969022e46135fa6dc7599fc2f3b4 got: 4334926a01c905cdb7fce71265e370c1 

I found this related answer , however this solution does not work, because git svn log is not working yet, because the repo is not fully installed:

 $ git svn log dc/trunk-4632-jh/dc-smtpd/lib/Qpsmtpd/Address.pm.t fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions log --no-color --first-parent --pretty=medium HEAD: command returned error: 128 

How can I continue?

+5
source share
4 answers

I know this is old, but perhaps it will be useful for future reference, since all the search results on this do not help.

I ran into a similar problem in our huge repository, which took several days to clone, and, unfortunately, at some point I had to restart my machine. I am currently developing how to solve the problem, so please keep in mind that this is a suggestion rather than a tested solution.

I think you need to try creating a branch and checking the commits that you have in the previous selection:

 git checkout -b master git-svn 

After that, you should have a working tree before this commit. Other samples are most likely to fail due to object mismatch, but at this point, at least, it should be possible to use "git svn reset" to return erroneous svn samples (see the OP link for the response link). If this is true, find the intruder, reset in front of him, and then continue to extract.

You might want to reinstall and revert to the state before this broken commit on your main branch or convert back to the bare repository if that is what you need (in my case it is).

Hope this works. I will send an update when my order is completed (takes at least several hours ... sigh).

Edit: This seems to have worked. I successfully canceled some git-svn commits and can retry them again. :)

Edit2: make sure to reset until you get a warning about object mismatches in git svn fetch (otherwise you will soon encounter the same problem).

Greetings

Henryk

+3
source

Another answer to the old question, but a direct solution is hard to find for this problem, so hopefully this will help others.

I think this problem occurs due to a damaged file during the transfer. I don’t know how and why this happens, but in my case I get the same error with different revisions every time I make a new clone, and sometimes at all.

Using error messages

 $ git svn fetch Checksum mismatch: dc/trunk-4632-jh/dc-smtpd/lib/Qpsmtpd/Address.pm.t 8ce3aea3f47dc115e8fe53bd62d0f074cfe93ec6 expected: 59de969022e46135fa6dc7599fc2f3b4 got: 4334926a01c905cdb7fce71265e370c1 

The following steps allowed me to resume and continue: -

  • View all branches. All this will be remote branches. git branch -a
  • Tracked verification branch. git control panels / start / trunk-4632-jh

    It will take some time.

  • Find the latest revision that the problem file has been modified. git svn log dc-smtpd / lib / Qpsmtpd / Address.pm.t

    Pay attention to the highest version

  • Reset back to this rev. git svn reset -r (rev #) -p

  • Go on. git svn fetch

Good luck.

+1
source

See also: Git svn rebase: checksum mismatch

In our case, additional file processing (server-side includes in Apache) caused a checksum problem.

Disabling SSI in Apache file /etc/httpd.conf during the migration period, commenting

  AddType text/html .shtml AddOutputFilter INCLUDES .shtml 
Directives

solved the problem caused by the interpretation of .shtml files on the Apache front-end server, which created new content (and therefore a new hash), except for the hash of the original file.

0
source

This means that some files in the repository are corrupted. This can be caused by various reasons, such as software errors, bit-cloves on disks, etc. I recently switched to a very old ~ 10 GB svn repository on git, so some damage was expected.

To fix the damage, you need to dump the entire repository and import it when filtering errors. Please note that our goal is to complete the import process no matter why and how the repository is damaged. You cannot just fix the corruption without having a backup and without viewing the version files.

The first basic one-time command you can use is:

 svnadmin create repo2 svnadmin dump repo | sed '/^Text-content-md5/d' | svnadmin load repo2 

This removes the checksum calculation from the dump, so the new repo will have updated checksums.

If you find more errors during the dump and loading (which is expected), try the incremental approach to continue working from the remaining point. Below, the command discards changes from 101 to 150 (inclusive).

 svnadmin dump --incremental -r101:150 repo | sed '/^Text-content-md5/d' | svnadmin load repo2 

Some common mistakes and solutions:

  • "Premature end of data content in dumpstream": this means that the length of the contents of some file does not match the version of the repository, so some data is lost in the specified file. We must skip this. Add team | svndumpfilter exclude path/to/file.jar | svndumpfilter exclude path/to/file.jar as follows:

     svnadmin dump --incremental -r101:150 repo | svndumpfilter exclude path/to/file.jar | sed '/^Text-content-md5/d' | svnadmin load repo2 
  • Property errors: add the --bypass-prop-validation svnadmin load to svnadmin load

After filling out the second repo you just svnserve -d -r repo2 and try git svn fetch again.

Good luck

0
source

Source: https://habr.com/ru/post/1200742/


All Articles