ryppl/Boost2Git — pull request #41 by ned14 (2013-09-03 06:31:03+00:00)
Title: Mismatched EOL content to svn:eol-style attribute detection and in-conversion fix

Note: ignore my deletion of git_push.cmake, this was to stop the script trying to upload the generated repos.

Note that conversion performance is significantly impaired by this improvement. I have cached precompiled regexs converted from the globs parsed from the gitattributes, but in the end we're adding ~90 regexs per file converted and it is not swift. I suppose one could fold all svneol=native attributes into a single regex which orrs the comparisons, but I am unconvinced it would be significantly faster.

Our next problem is that early Boost commits did not set svn:eol-style despite adding text which could contain any variant of CRLF or LF, including both EOL types in the same file. I rewrote much of the original C++ to use C's memchr() in order to try and improve on performance here, but ultimately we end up having to run the EOL converting pass for all text without a svn:eol-style specified just in case. Again, this is not swift as it involves having to append chunks into a realloc()'d block as git's fast-import needs to know the exact size of the file being added before being added, and one cannot precalculate this.

I added some warnings printing which files are incorrect EOL repaired. These include all the files submitted as faulty in the original bug report, plus many others we didn't know about before. They are listed at https://gist.github.com/ned14/6420324 for reference. Note that later commits may have fixed up bad EOL in earlier commits, either way we fixup during commit replay so all old commits should be now git correct.

Let me know if you have any questions.

Niall