If you use the source control command-line interface (CLI)
to share a project or check in a file, you can use a magic file
to change the default mapping between the file name extensions and
the line delimiter types.
About this task
If the CLI does not recognize a file type, it is treated
as a binary file. The CLI does not automatically convert the line
terminator characters between different styles for binary files. For
example, the CLI does not convert the characters between Windows and UNIX styles.
Also, the CLI does not attempt to automatically resolve merge conflicts
in the file contents when the file is binary.
Procedure
- Create a magic.properties file:
- On UNIX or Linux®, this file resides in home_directory/.jazz-scm/.
- On Windows, this file resides in LOCALAPPDATA\jazz-scm\. For Windows 7, LOCALAPPDATA defaults to C:\Users\userid\AppData\Local.
Note: If you save the magic.properties file
to an alternate directory instead of your home directory, you can
specify that it be read from this alternate directory by setting the
environment variable SCM_CONFIG_DIRECTORY. Set
it to the full path of the jazz-scm directory.
For example, C:\temp\jazz-scm.
- Edit the magic.properties file.
- Example 1: *.txt: delim: lf
- Example 2: *: delim: platform
- Example 3: *.go: mime: text/plain; delim:
platform; encoding: UTF-8; respectcase:true
- mime indicates the MIME type of file names
that match the specified pattern.
- encoding sets the encoding for file names
that match the specified pattern.
- respectcase controls the case sensitivity
of the pattern.
- delim sets the delimiters for file names
that match the specified pattern. The delim keyword
can have any one of the following values:
- lf indicates that line feeds (ASCII 0x0a) are
new lines in the file.
- cr indicates that carriage returns (ASCII 0x0d)
are new lines in the file.
- crlf indicates that carriage-return/line-feed
pairs are considered new lines in the file.
- platform indicates that Engineering Workflow Management should use
the platform-specific character to denote new lines.
- none indicates that no new line conversion occurs.
- Optional: If you run the scm checkin or scm
share commands, the new files are added to Engineering Workflow Management source
control and use the delimiter type that is identified by the magic file.
- To change the encoding for files that are checked in from the CLI or Engineering Workflow Management Client for
Microsoft Visual Studio IDE, run scm set
property. Run this command for cases where the encoding of files needs more control than
the magic.properties file provides. Example: scm set property
file.encoding UTF-8 path/to/file.
- file.encoding: When set to an encoding, this property indicates that the
specified encoding is the encoding for that file instead of the encoding from the
magic.properties file.
- preserve.file.encoding: When set to true, this property indicates that
the file encoding remains the same, regardless of what encoding is specified in the
magic.properties file.
Note: Check-ins from the Eclipse client use the encoding that is configured in the Eclipse resource
model, and changes made in the web client use the encoding that is specified through the web
client.