[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: line-ending conversion and keyword substitution

From: Bruce Atherton <bruce_at_callenish.com>
Date: 2001-12-13 05:20:58 CET

At 07:13 PM 12/12/01 -0500, Greg Hudson wrote:
>Let's say I'm on Windows, and we're using your newline proposal. I
>create my no-vectors graphic file, save it, and check it in. Let's say
>the initial contents are "VEC\n", which would be a little odd,
>especially for a Windows program, but this is a binary format; it could
>be anything. Then, next week, I check out the file. Even though it
>came from Windows, my client transforms the file contents to "VEC\r\n",
>because it has no idea where the file came from; it just thinks it looks
>like a Unix text file.

Well, no. As we discussed earlier, it wouldn't make sense to set
line-ending-style to "native" for a file that didn't have any native line
endings. It's style would get set to "none", and no transformations would
be done on it.

I guess I missed that behaviour in my proposal though, didn't I. Ok.
Proposal Part Deux.

5. The line-ending-style should by default be set to "native" only if the
file type is considered "text' as opposed to "binary" (according to
heuristics discussed elsewhere) AND the file contains line endings that are
appropriate for the platform it is being checked in from AND it contains no
line endings that are inappropriate for the platform. Otherwise the
line-ending-style should be set to "none". The user can override this as
they see fit, of course.

6. If a file has a line-ending-style of "none", then none of the line
separator alterations discussed in point 2 will ever occur. That means that
the reverse alterations on a commit will likewise never occur.

As an aside, there has been some discussion about setting the
line-ending-style value to the platform, such as "unix", "dos", or "mac",
or to the sequence of characters that make up the line separators, but I
don't see the point here. The question you are trying to answer is whether
a line-ending conversion will occur or not. The "native" and "none" should
tell you everything you need to know on that score. For efficiency (or the
ability to convert the line endings of a file already in the repository)
you may want to set another property that indicates what line endings a
file has in the repository (only necessary if the line-ending-style is
"native", obviously), but that is an implementation detail.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:52 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.