[darcs-users] Windows end-of-line characters
Peter Strand
peter at zarquon.se
Mon Jun 21 08:51:46 UTC 2004
Peter Maxwell wrote:
> This issue has been causing me problems. Here is what I think I know:
>
> Windows text file lines are terminated with CR LF, unix with just LF.
>
> Most version control software automatically (sometimes optionaly)
> converts text files to have native EOLs, so the same file will have CRLF
> on windows and LF on unix. GPG does something similar, in some modes.
> So do email clients, web browsers etc.
>
> darcs doesn't yet have a policy on end-of-line characters. Current
> behaviour is mostly to not do any such conversions.
...
> OK, that gets us to a consistent absence of EOL conversion. Now,
> thinking about what it would take to have deliberate EOL conversion:
>
> I have a script that unpacks darcs patches emailed from windows, and as
> a final step strips out any CR characters before passing it on to darcs
> to apply, but patches more often travel by protocols that don't let a
> script get a look in (scp and http (not as text/plain so no EOL
> conversion)) so either patches should be always be stored with LF line
> endings, even on windows, or darcs needs to convert either type to
> native EOLs on any platform.
I think it is best to keep patches and metadata in a canonical format,
using LF as it is now, and do the conversion when darcs modifies files
in the working copy. Perhaps we could have a new category of files, in
addition to "boring" and "binaries", to specify that they should be
converted to or from the native text format when written or read?
/Peter
More information about the darcs-users
mailing list