[p4] line endings
Pavloff, Alex (IE) @ SONOMAEO
alex.pavloff at l-3com.com
Wed Aug 15 09:50:57 PDT 2007
I've got a few multi-platform issues also -- they are very sensitive to
line-endings in text files.
Easy solution? Change the filetype from "text" to "binary+D" on the
Presto, Perforce doesn't do anything to the line-ends, but still uses
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Ivey, William
Sent: Wednesday, August 15, 2007 8:16 AM
To: perforce-user at perforce.com
Subject: Re: [p4] line endings
> If a file is a text file, and the normal way that the
> file is stored on that system is with CR/LF line endings,
> then when a TEXT file is checked in, whatever line endings
> are used, they should be translated to the line endings
> that machine uses. If I checkout a file, the line endings
> should "convert" (if necessary) to the line endings that
> are normal on my machine.
I thought I was clear that this is exactly what I do not
want to happen. No matter what the client machine is, we
MUST be able to sync and submit text files in ANY format
we need no matter what kind of machine the client is hosted
on. Nothing else is acceptable since it would prevent us
from building the multiple-platform images we have to ship.
(Or at least complicate an already complex task to the point
of unacceptable risk.)
From: Qazwart [mailto:qazwart at gmail.com]
Sent: Tuesday, August 14, 2007 11:56 PM
That's the reason I said "normalizing" instead of what type of file
it should be. If a file is a text file, and the normal way that the
file is stored on that system is with CR/LF line endings, then when a
TEXT file is checked in, whatever line endings are used, they should
be translated to the line endings that machine uses. If I checkout a
file, the line endings should "convert" (if necessary) to the line
endings that are normal on my machine.
In a source control system, all files are considered "text" unless
there is a reason to consider them otherwise. I can only think of two:
Heuristic evidence on the file suggests it is not pure text (i.e.
contains characters other than the around 90 text characters), and
the file itself is marked as a binary file.
I've used Subversion, and I know that it seems to handle the line
ending situation much better.
> The problem, in my experience, arises from user
> inconsistency. People pass files around from systems of
> one flavor to another. People change their client's
> line ending setting then submit without refreshing the
> sync file. Some people just decide to change the text
> format because they have no clue it matteres. People
> ignore my warnings - a LOT.
Nothing you stated should cause a problem (the emphasis on SHOULD).
When a file is submitted, the server should scan and replace any
necessary line endings unless the file is marked as binary. This
should happen no matter what line endings are used in your file, or
whatever line endings you client is using.
david at weintraub.name
qazwart at gmail.com
perforce-user mailing list - perforce-user at perforce.com
More information about the perforce-user