[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[stellation-res] Text file normalization
|
The implementation of text file normalization in TextArtifact.normalize()
presents problems for Windows in some special cases.
Unfortunately, Windows text files can show an amazing variety of line and
file termination conventions, particularly with legacy applications. I would
suggest that the following approach, based on what is done in other SCM's
such as Visual SourceSafe should cover most of the cases.
1. Store all lines internally without any line end of file end characters
and do not include such characters in signature calculations.
2. The default line end should be the "natural" one for the platform where a
file is being written. This fits well with the Java file library which
provides this support out-of-the-box.
3. It should be possible to specify properties, at a project, workspace and
individual file level to override the "natural" behaviour. These overrides
will cover the more unusual environments such as writing directly to an NTFS
file from a Unix workstation using Samba or vice-versa.
4. The following properties will be needed. All properties can optionally be
qualified by a platform identifier in which case they will only apply when
files covered by those properties are being written on the specified
platform by local Stellation software as opposed to software such as NFS or
Samba.
Line end is line feed only
Line end is carriage return only
Line end is line feed followed by carriage return
Line end is carriage return followed by line feed
DOS end of file character required
The DOS end of file character is particularly nasty, but fortunately seems
to be on the way out. It provides a logical end of file signal even if the
physical file contains other characters following it.
You will need to be able to apply these properties, even on Unix platforms,
to cover special cases where DOS and Windows format files need to be stored
temporarily on a Unix platform, paerhaps as input to a cross-platform
installer that must deal with legacy issues.