views:

1484

answers:

1

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.

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:

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.

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.

Thanks in advance for any help.

+4  A: 

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).

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).

CesarB
The hash stays the same, huh? Well, I should have known/remembered that git hashes the actual bytes of the commit delta. Unfortunately, I may run into differences on account of me wanting to overcome the CRLF <-> LF issue the second time around. I will try re-importing, though. Thanks!
Pistos
Okay, CesarB, I tried to reimport from the svn source by doing a git svn init, setting autocrlf to input, then git svn fetch -- but I get the very same error ("delta source...") in the middle of the fetch. Any other suggestions?
Pistos
Try without playing with autocrlf at all, like your initial mirror. If it keeps having that error, I would suspect it's either svn or git-svn that's broken.
CesarB
Well, without the crlf settings, things function fine, but the merges panic about the line ending differences and show huge diffs even though the only delta has to do with whitespace. I also tried whitespace = cr-at-eol, but that doesn't seem to help in this regard.
Pistos
Anyway, this could be an abandoned issue because the watir project is reportedly fully moving to git before the year end. Thanks for your input nevertheless.
Pistos