[darcs-users] CRLF Problem

Kurt Granroth darcs-users at granroth.org
Thu May 3 21:52:41 UTC 2007


I'm trying to roll out darcs to the devel group at my job as well and so far 
there is only one show-stopper... the "CRLF Problem".  The lack of a 
WinCVS-like GUI is slowing things down and its memory hog tendencies 
(especially on Windows) is also not winning any fans, but the quantum leap in 
possibilities is trumping all.  Except for the CRLF issue.  We have too much 
development where files are shared between Linux and Windows developers to 
just mandate one line ending.

I see that a pre-hook might be implemented in the future and that would 
definitely work.  But what about now?  What are some of y'all doing now to 
workaround this in the meantime?

For the record, I've got something almost-sorta working.  Basically, I create 
the "main" repository on a Linux box with Unix line endings.  It's called 
something like:

unix/project/version

I then do a 'get' into a "windows specific" version like so:

win/project/version

At this point, I run the attached 'darcs2dos' script which converts all 
non-binary files in pristine and the working tree into DOS format *and* tries 
to convert the patches as well.  Windows developers then use the 'win' repo 
as the master and Linux developers use the 'unix' one.  When it comes time to 
sync the two repos, I run the 'darcs2unix' script (same file.. hard-linked) 
to convert everything back to Unix line endings.  I then push and pull all 
the of the changes while everything is in Unix mode.  Finally, I re-run 
the 'darcs2dos' script on the 'win' repo.

That *almost* works!  That is, it works great for some projects but doesn't 
work at all for others.  The problem is that *sometimes*, darcs does 
an 'addfile' diff with an empty line as the "old" file.  If this line is 
converted to DOS format, then darcs crashes and burns while applying the 
patch.  So the darcs2dos was modified to skip lines that start with '-' in 
the patch... but then darcs crashes and burns on 'rmfile' in any patch other 
than the first one.

So close!

If anybody has a better method or a way to get this script to work, please let 
me know.  This is the only issue that keeping us from rolling a bunch more 
projects and developers on board.

Kurt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: darcs2dos
Type: application/x-shellscript
Size: 1474 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20070503/3be12abe/attachment.bin 


More information about the darcs-users mailing list