[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [stellation-res] what does "Fixing file not in standard form :" mean?
|
On Wed, Jul 24, 2002 at 07:49:55PM -0500, Florin Iucha wrote:
> On Wed, Jul 24, 2002 at 08:22:50PM -0400, Mark C. Chu-Carroll wrote:
> > On Wednesday 24 July 2002 08:03 pm, Florin Iucha wrote:
> > > On Wed, Jul 24, 2002 at 07:11:30PM -0400, Mark C. Chu-Carroll wrote:
> > > > On Wednesday 24 July 2002 05:03 pm, Florin Iucha wrote:
> > > > > Hello,
> > > > >
> > > > > I am adding a bunch of files to a project and I'm getting tons of:
> > > > > Fixing file not in standard form : /path/to/file
> > > > >
> > > > > What does it mean?
> > > >
> > > > It means the file ends without a carriage return on the last line. Each
> > > > line of a text file is supposed to have a carriage return at the end.
> > > > Stellation normalizes text files if they don't have a CR at the end.
Actually, the character on Unix is LF, not CR.
> > >
> > > 1. Then the message should be explicit and tell me what it does.
> >
> > We thought that's what it's doing. Standard form for text files
> > is a carriage return on the end of each line. I thought that was
> > a reasonably good message for what it's doing. Would it be
> > better to just say "Adding carriage return to normalize text file"?
>
> It would certainly be better.
>
> > > 2. I still don't think it is proper to change a file without asking me.
> >
> > It's only adding a carriage return. Which it does for a reasonably
> > good reason.
It's not always just adding a LF. For example, if you do an edit on Windows and move the file
over to Unix without doing the usual normalization, then each line ends with CR and LF, not just LF.
There are are also other possibilities, such as ^Z at end of file.
of
>
> I agree it is a good reason.
>
> > > 3. Why shoult Stellation care about the contents of the file? For
> > > merging?
>
> [snip]
>
> > If you think it's really important, it's not a terribly hard thing to do to
>
> I think a file should be kept as I created it, except when I ask for
> stuff to happen to it (keyword expansion, etc.).
>
Trying to keep the file 'as created' is a non-trivial task. Suppose you
have a file consisting of a single line with the character 'a'. On Unix this will
result in a file of two bytes, one for 'a' and the final LF. Suppose you remove the
final LF. Have you changed the file? Some versions of diff say you have, while others
save you have not; indeed, there have been several discussions on the Subversion list about
the problems caused by incompatible versions of diff.
Now suppose you do a check in. The repository will contain the file in its 'normal' form, due
to the way Java IO works. Now if you do a checkout, the file you get back will not be the same
one that you checked in. This is the main purpose of normalization -- to avoid the sorts of problems
that can result trying to keep the file 'as created'.
There is a discussion of this near the end of the Overview section of the Guide.
> But don't take my word for it. Add the good explanation that you put in
> this message into the FAQ and if more votes pour in, consider making it
> an option.
>
> Thank you,
> florin
Making this an option is NOT, in my view, an option, due to the problems trying to maintain
multiple representations of the 'same' file.
dave
--
Dave Shields, IBM Research, shields@xxxxxxxxxxxxxx, http://www.eclipse.org/stellation