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

Igor Bukanov ml at igor.fastmail.fm
Sun Oct 31 12:06:09 UTC 2004


Martin Schaffner wrote:
...
> Michael Conrad  conradme at email.uc.edu wrote:
...
>>So, the easiest solution would be for windows versions of darcs to
>>automatically strip \r.  Another solution is to make Ned use an editor
>>capable of unix newlines, and get Ned to turn on that feature, which 
>>might
>>have to be enabled on a per-project basis.  I think we all know the 
>>futility
>>of the second option.  Its usually effort-enough just to get Ned to use
>>version control.
>>
>>In the case that you have a samba-mounted home directory, you could of
>>course manually add the pref for line endings, since this is something 
>>that
>>you deal with and understand.
> 
> 
> What would the correct line ending be for a repo that's on a drive that 
> you mount from Unix as well as from Windows?

As it was already pointed out, there are 2 cases to consider:

1) New text goes to the _darcs repository. Ideally I would like darcs to 
accept all 3 line endings, \r\n, \n and \r even if they are mixed in the 
single text file. That is darcs should split the text file into lines 
and work with logical lines and not their physical presentation. 
Internally the lines can be separated by \n but that is OK since if 
somebody wishes to edit stored patch files, then the person can deal 
with line ending there as well.

In that way it would not matter in which format data stored in the 
working directory and it is not an issue even if the drive is accessible 
by different OS with different tools.

2) Darcs generates text output from the context of _darcs repository. In 
this case it would nice IMO if there is a flag to specify a particular 
line ending for the working files and patches which defaults to platform 
specific line ending or existing file context. That is, for new files or 
output to stdout darcs should use this flag while for the existing files 
the present line endings should be preserved.

Again the case of accessing the working directory from different OS 
would not matter. Yes, the working directory may end up with text files 
having different line separators but given 1) that would not confuse 
darcs and to avoid confusing with tools (like notepad on Windows ;) the 
explicit line ending for the output can be specified.

Regards, Igor




More information about the darcs-users mailing list