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

Kannan Goundan cakoose at yahoo.com
Mon Nov 1 18:40:54 UTC 2004

I'm all for logical lines.  It's not a completely new concept since
Darcs hunks already work at the level of lines (right?).  Some people
seem to be worried about Darcs modifying files on the fly, but I
think there's a way to minimize that problem.

1. Hunk patches can specify their line-ending.  This can be done by
   - Keeping the line endings on the '+' hunk entries.
   - Always using '\n', but specifying the line-endings at the top of
the hunk.

2. When Darcs modifies a working copy of an existing (non-empty)
file, it should detect the line ending of the working copy and
preserve it.

3. When Darcs has to add content to a new file (or add to an empty
one), it has to decide what line-ending to use.  This preference
setting can be one of:
   Unix  - \n
   DOS   - \r\n
   Host  - Use the host's default line ending.
   Patch - Use same line-endings as the latest hunk patch.

I think that this will minimize the chances that Darcs will change
the line-ending format on you.

Though you probably lose determinism for what the line-endings are, I
don't think this causes problems as long as the line-endings are
treated as a form of out-of-band configuration data and not as part
of the repo state proper.

I don't know how useful the 'Patch' option is.  If nobody needs it,
then hunk patches no longer need to specify a line-ending.

BTW, Visual Studio seems to allow mixing both types of line-endings
in a single file.  If you open up a Unix file, change some lines, and
save it, all the unmodified lines will be Unix and the modified ones
will be DOS.  Not sure if Darcs should handle this or not (Vim

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the darcs-users mailing list