[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: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2001-12-12 15:39:30 CET

On Wed, 2001-12-12 at 02:16, Bruce Atherton wrote:
> At 08:06 PM 12/11/01 -0500, Greg Hudson wrote:
> > - When committing, if working file's style doesn't match the
> > file's official line-ending-style, then a converted copy will be
> > sent to the repository.
> >
> >Presumably that applies to the initial commit as well as later commits.
>
> But on an initial commit, there is no official line-ending-style for the
> file, is there? I read this as "the first commit determines
> line-ending-style" because the repository has no 'preferred' format.

Ben's document said:

 - define a 'default' line-ending style to SOME convention that
   ALL clients agree upon. *** If no line-ending-style property
   is set, this is the style that the text file is assumed to
   have. ***

This might be subject to interpretation, but my reading is that there is
some kind of Subversion-wide global default line-ending style, which can
be overridden by a property, but we apply the global default style to
the initial commit if the property is not set.

However, for the sake of argument, let's say that we deduce the
line-ending style from the first commit which has line endings. This
still won't protect us. Let's go to my vector graphic example:

> Step 1. You commit the file with no contents. Probably not the most common
> occurrence, but it is your story so you get to make it up and yes, it will
> happen. Probably the best design would be to say that if there are no line
> feeds in the file, it's "official line-ending-style" is "none", so no
> conversion will ever happen to this file until that property is changed
> manually. End of problem.

I didn't say I committed the file with no contents, just with no
vectors. Presumably there would be some boilerplate as part of the
vector graphic program's binary format (just like svndiff has a little
ID string at the front). Moreover, I didn't say there were no line
endings in the file, just that there was nothing resembling *a line
ending which needed translation*. Perhaps the file happens to contain
bare LFs but no CRs or CRLFs which would need translation to LFs.

In step 2, when I commit the file with lots of contents, it is likely to
contain, just by chance, CRs and CRLFs as well as bare LFs, due to the
addition of lots of vectors.

---------------------------------------------------------------------
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.