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

Michael Conrad conradme at email.uc.edu
Sun Oct 31 20:19:25 UTC 2004


On Sunday, October 31, 2004 1:24 PM, Martin Schaffner wrote:
> Michael Conrad wrote:
> > > > This default would be determined at compile time,
> > >
> > > This would mean that the version of darcs alone would not tell
> > > you what behaviour it shows.
> > > If a "default line ending" feature goes into darcs, then it
> > > should be per-repo and not per-darcs-executable
> >
> > I think it should be a property of the repo instance, but
> > determined by the executable/global pref at the time the repo
> > is initialized. It makes sense to me that Windows exes would
> > default to windows lines on any repo that the user creates/gets.
> > Likewise, a unix user should get unix line endings by default.
> > I also think this would be easy to set in the .configure script.
> > If you want to override it, then set the global pref.
> >
> > > Or the "standard line encoding" could be stored in _darcs/prefs/
> >
> > I think the patch encoding should be the same accross all repos,
> > so that people can get and pull eachother's data without worrying
> > about repo type.
> > I think the encoding of the working copy should be platform
> > specific, to best interact with the tools you use on the working
> > files.
>
> If I get this right, you suggest there are two line endings in use:
> The patches' line endings (for which you propose '\n'), and the repo
> line endings (what is in the source tree one edits).
> This leaves some questions:
> * What line endings should _darcs/current have?
> * If I switch the repo-line-ending, does darcs have to switch all
> line endings, or will "darcs check" tell me everything is not allright?

First, see Igor's post.  I like his idea.
Then, _darcs/current wouldn't matter, but they might as well be in
user-specified encoding, so the user can play with them with minimal fuss.

> Except if they get the idea to "cp -r" a repo from a Windows
> machine, for example because it contains unrecorded changes...

Also solved by Igor's idea.

> The implementation might not be that huge, but it makes the UI more
> complex as well. I'd have to worry about three line endings: The
> global pref (I take it you're speaking about the setting in the home
> dir, and not the patches' line ending), the repo-specific pref, and
> the line ending of my editor. And the additional cost of not being
> sure that darcs gives me the data back in the state I gave it to darcs.


> > > 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?
> So this is one more thing I'll have to worry about: On which machine
> should I create the repo, or if I'm on the "wrong" machine, I'll have
> to change the pref (and do "darcs repair"?)

If the default is platform-native, and you only have one platform, there's
nothing to worry about, and considerable benefit if project members use
different platforms.

If you use multi-platform arrangements, you usually have to standardize
anyway.  I can't see why someone would want to have text files with mixed
encodings.  On my setup (Win2K dual-head with Gentoo single-head and FreeBSD
fileserver with numerous shared filesystems) I gave up on managing the
encodings and standardized on \n.

And just in case there's any confusion, I'm saying that EACH COPY of the
repo would have a encoding preference.  If you create the repo with the
wrong default, just pull it into a repo with the right default.  And, with
Igor's idea, you could change the default of an existing repo without any
adverse effects. (though it wouldn't automatically change the encoding of
the existing working files)

-Mike





More information about the darcs-users mailing list