Oblomov/rcs-fast-export

missing sequential mark number

instantchow opened this issue · 5 comments

So I'm running into an error on the Git fast-import end that seems to be related to missing these file marks in sequence. Here's a log from a run:

...
retry with commit fuzz < -61.0 if you don't want to see this message
2001 coalesced commits
fatal: mark :5211 not declared
fast-import: dumping crash report to .git/fast_import_crash_20328
D:/gitmig/rcs-fast-export/rcs-fast-export.rb:752:in `write': Broken pipe @ io_write - <STDOUT> (Errno::EPIPE)
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:752:in `puts'
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:752:in `puts'
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:752:in `export'
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:1161:in `block in <main>'
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:1161:in `each'
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:1161:in `<main>'

Anyone know where I should start digging on this one?

When I run this without the pipe into git fast-import and look at the output, I see that I am indeed missing a line for mark :5211. After that one, it seems like there are more and more missing "marks".

Thanks!

Looks like this issue of mark :s not being sequential is related to using the --skip-branches option. Which I used since when I do not have it, the script raises this:


Preparing commits
D:/gitmig/rcs-fast-export/rcs-fast-export.rb:701:in `initialize': NoBranchSupport (NoBranchSupport)
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:1044:in `new'
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:1044:in `block (2 levels) in <main>'
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:1042:in `each'
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:1042:in `block in <main>'
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:1041:in `each'
        from D:/gitmig/rcs-fast-export/rcs-fast-export.rb:1041:in `<main>'

Ok, So looks like the issue is with running this script in Windows 7 under mingw. I was hoping I could build a conversion tool that ran in Windows for my users, but I'm shelving it.

$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]

I switched running the script in CentOS and the output is fine. I suspect it was skipping some of the RCS parts in some files with strange text encoding or binary files. I haven't inspected it further than doing a quick compare of the outputs from both systems.

Closing for now, let me know if you would like more info.

Hello and sorry for not replying earlier. I'm glad to hear that you managed to work around the issue by running the script in CentOS, but I would prefer it if you could manage to find why it's misbehaving in mingw. It might be sufficient to open the file in binary mode (line 393. add a b after ther in the file mode) (in fact, it might be appropriate to do this anyway lest CR/LF pairs in the files text get converted, I'm thinking). Can you verify that this is indeed the case? If it works, can you compare the repository content with the ones obtained in CentOS?

I was encountering the same issue running this script on Windows, I updated line 395 to have the b after the r as you suggested and it resolved the problem. Thanks!

Thanks for the report. I've integrated the change, which apparently also renders the encoding specification unnecessary.