15.6 Configuring Text Modes for Views

UNIX and Windows observe different conventions for terminating lines in text files. UNIX systems normally terminate lines with a single <LF> (line feed, or new line) character and Windows systems terminate lines with a two-character <CR><LF> (carriage return, line feed) sequence. Some Windows applications can read and display files in either format, some Windows applications always write files using <CR><LF> format, and some Windows applications can be configured to determine which format to use.

Because of these different conventions, line-termination problems are a typical result of the use of text editors on files that must be edited on both UNIX and Windows platforms. For example, a file with the contents:

abc
def
ghi

would look like this if it were created by a typical Windows editor and read by a typical UNIX editor (for example, vi):

abc^M
def^M
ghi^M

The UNIX text editor renders the <CR> character as ^M. The same file would look like this if it were created by a typical UNIX editor and read by a typical Windows editor (for example, Notepad):

abcdefghi

To better support parallel development in mixed operating system environments, Rational ClearCase LT provides a text mode setting for views that controls how line terminators are handled when text files are presented to applications.

Text Modes

Each view has a text mode setting that specifies how it handles line terminator sequences. This setting only applies to file elements whose element type is text_file or a subtype of type text_file. You determine a view's text mode when you create the view. You cannot change the text mode of a view after the view has been created.

A ClearCase LT site configuration parameter determines the default text mode for view creation. For details, see the reference page for the setsite command.

You can create a view in any of three text modes:

In a view created in either insert_cr or strip_cr text mode, ClearCase LT adds or removes the <CR> characters whenever it updates the view. It reverses the <CR> manipulation (adding or removing <CR> characters as appropriate) during the checkin process.

NOTE: You cannot create a view in strip_cr mode from any GUI.

Determining a View's Text Modecontents@cc_inter.hlp">

If you do not know a view's text mode, you can find out in one of two ways:

With these methods, transparent text mode is displayed as unix, strip_cr text mode is displayed as strip_cr, and insert_cr text mode is displayed as msdos.

Choosing a Text Mode for a View

ClearCase LT does not enforce any policy governing access to VOBs based on a view's text mode, and a user editing a file in a view that has the "wrong" text mode configuration can cause problems for other users who need to edit that file. Most sites with both Windows and UNIX development platforms should adopt a policy that allows users of the primary development platform to create views in transparent text mode and that limits the use of strip_cr or insert_cr text modes for the minority of platforms that require different line-termination conventions.

If most of your users are developing software on UNIX:

If most of your users are developing software on Windows:

No matter what policy you adopt, it is important to maintain a consistent combination of client platform, view text mode, and VOB. If a client uses a view in an interop text mode (strip_cr or insert_cr) to access a VOB, then later begins using a view in transparent text mode to access the same VOB, versions created by the views in different text modes will be difficult to compare or merge.