[darcs-users] Re: Line endings opinion poll (with bonus option)

Peter Strand peter at zarquon.se
Thu Nov 4 07:06:02 UTC 2004


Björn Lindström wrote:
> Martin Schaffner <schaffner at gmx.li> writes:
>>How about a single --using-dos-line-endings option for all relevant
>>commands, that is disabled by default, can be added to
>>_darcs/prefs/defaults, and does:
>>
>>* Turn '\n' into '\r\n' when adding lines from patches into working
>>* Turn '\r\n' into '\n' when creating patches from working
> 
> ...
> Still, it may be a good idea to make the options take arguments, like:
> 
> --line-endings=dos
> --line-endings=unix

This is basically what I implemented a couple of days ago, by modifying
(read|mmap)FileLinesPS and writeContents to adapt line endings.

I that enough? I'm not that familiar with the IO-paths i darcs.

I also had to add an extra argument to a lot of the functions in
SlurpDirectory.lhs to allow the desired line ending to be specified,
since that is a repo-preference or command argument, which
slurpdirectory knows nothing about.
Not very pretty.


The repository with these patches is available here:

http://zarquon.se/repos/darcs-line-ending-option

But it's not very well-tested at the moment. Or tested at all.
However, I need this functionality now, so it will be tested and fixed
in a couple of days ;)


/Peter




More information about the darcs-users mailing list