xcleardiff

Compares or merges text files graphically

Applicability

Product

Command type

VersionVault

command

Platform

UNIX®

Linux®

Synopsis

  • Compare files:
    xcleardiff [ –b/lank_ignore ] [ –tin/y ] [ –html ]
    [ –hst/ack | –vst/ack ] [ X-options ] pname1 pname2 ...
  • Merge files:
    xcleardiff –out output-pname [ –b/lank_ignore ]
    [-favor/_contrib n (base=1,...) ] [ –bas/e pname ]

    [ –tin/y ] [ –html ] [ –hst/ack | –vst/ack ]

    [ -q/uery | -qal/l | –abo/rt ] [ X-options ] contrib-pname ...

Description

xcleardiff is a graphical diff and merge utility for text files. It implements the xcompare and xmerge methods for the text_file and compressed_text_file type managers, as well as the graphical portions of these methods for the directory and _html type managers. On color display monitors, xcleardiff uses different colors to highlight changes, insertions, and deletions from one or more contributing files. During merge operations, contributors are processed incrementally and, when necessary, interactively, to visibly construct a merge results file. You can edit this file directly in the merge results pane as it is being built to add, delete, or change code manually, or to add comments.

xcleardiff is implemented as an X Window System application using a standard Motif toolkit. For a description of general mouse and keyboard conventions, see your X Window System documentation .

Invoking xcleardiff

You can invoke xcleardiff directly from the command line, specifying files or versions to compare or merge. Invoking xcleardiff directly bypasses the type managers, so invoke xcleardiff directly only when you are working with text files that are not stored in a VOB.

The following cleartool subcommands, when applied to text files, also invoke xcleardiff:

  • diff –graphical
  • merge –graphical
  • findmerge (with options –graphical or –okgraphical)

The findmerge command includes the advantage of some extra command options—optional preprocessing—in the same way that diff and merge offer more flexibility than direct calls to the character-based cleardiff utility. See findmerge –ftag, for example.

Various buttons and commands in the xversionvault graphical interface also invoke xcleardiff.

Note: When comparing or merging HTML files, if the machine on which you run xcleardiff is not the machine on which you run your HTML browser, your browser may not be able to find the pathname to the files being compared or merged.

Changing the default HTML browser

xcleardiff invokes a script to determine which HTML browser to use when comparing or merging files of type html. By default, xcleardiff starts the Netscape browser through the script display_url.sh. To change the default values, use the following environment variables:

CCASE_WEB_SCRIPT (Default value: $CLEARCASEHOME/etc/display_url.sh)
Invokes the script specified, which designates the browser to use.
CCASE_NETSCAPE (Default value: "netscape")
Changes the default version of the Netscape browser to the specified version. If the Netscape browser is accessible through $PATH, you need only specify the executable name; if it is not in your path specification, you must specify a full pathname.
CCASE_NETSCAPE_OPT (Default value: NULL)
Provides additional command-line options to the Netscape browser through the script, for example, –install to force the Netscape browser to use a private colormap.

Restrictions

See the diff and merge reference pages.

Options and arguments

Handling of white space

Default
When comparing files, xcleardiff pays attention to changes in white space.
–blank_ignore
When comparing and merging files, causes xcleardiff to ignore extra white space characters in text lines: leading and trailing white-space is ignored; internal runs of white-space characters are treated like a single <SPACE> character. If this option is specified at merging, it must be specified with -favor/_contrib.

Font size

Default
xcleardiff uses the font specified by the resource xcleardiff*diffFontSet.
–tiny
Uses a smaller font, to increase the amount of text displayed in each pane.

Invoking the type manager for HTML files

Default
When xcleardiff is invoked directly, the type manager is bypassed. When xcleardiff is invoked indirectly (through cleartool or the graphical interface), the type manager is used.
–html
Starts the _html type manager.

Contributor pane stacking

Default
Each file included in the comparison or merge is displayed in a separate subwindow, or contributor pane. By default, these panes are displayed, or stacked, horizontally (side by side), with the base contributor on the left.
–vstack
Stacks the contributor panes vertically, with the base contributor at the top.
–hstack
Displays the contributor panes horizontally (the default behavior).

Merge results file

Default
None. You must specify a merge results file with the –out option.
–out output-pname
(Merge only; required) Specifies the merge results file, either a checked-out version or a standard operating-system file.

Specifying a base contributor for a merge operation

Default
xcleardiff does not calculate a base contributor (see the merge reference page). The first contributor named on the command line becomes the base contributor, against which the one or more additional contributors are compared. Query on All mode (–qall) is in effect by default, but can be deactivated from the graphical interface.
-favor/_contrib n (base=1,...)
(merge only) Specifies the contributor, in numeric value, to be used to fill in the non-changed areas of the merge output file. This option must be used with both –out and –b/lank_ignore.
–base pname
(merge only) Makes pname the base contributor for a merge. Using –base turns off Query on All mode, unless –qall is explicitly supplied. See also Merge automation.

Merge automation

Default
If you do not specify a base contributor with –base, Query on All mode is enabled. In this mode, xcleardiff prompts you to accept or reject each change, insertion, or deletion found in contributors 2 through n on the command line. The options described in this subsection have no effect.

If you specify a base contributor with –base, xcleardiff performs the merge automatically, prompting only if two or more contributors modify the same section of the base contributor. If all changes can be merged automatically, xcleardiff prompts you before saving the merge results file.

–query –qall –abort (mutually exclusive)
–query turns off automatic merging for nontrivial merges (where two or more contributors differ from the base file) and prompts you to proceed with every change in the from-versions. Changes in the to-version are accepted unless a conflict exists.

–qall turns off automatic acceptance of changes in which only one contributor differs from the base file. In this mode, xcleardiff prompts you to accept or reject each modification (relative to the base file) in each contributor, as it does when two or more contributors differ from the base contributor. You can switch this mode interactively during the xcleardiff session.

–abort is intended for use with scripts or batch jobs that involve merges. It allows completely automatic merges to proceed, but aborts any merge that would require user interaction.

X Window System options

Default
None.
X-options
xcleardiff accepts all the standard X Toolkit command-line options (for example, –display), as described in the X(1) reference page. If the option string includes white space, enclose the string in quotes.

Diff/Merge contributors

Default
None. You must specify at least two files for a diff operation, and at least one file for a merge operation (two, if a base contributor is not supplied with –base).
contrib-pname ...
The files to be compared or merged. If a merge operation does not explicitly include a base contributor with –base, the first contrib-pname becomes the base contributor. For a diff operation, xcleardiff does not calculate a common ancestor (see the diff reference page); the first contrib-pname is the base contributor against which subsequent contributors are compared.

Examples

  • Compare two files in different directories.

    % xcleardiff test.c ~jpb/my_proj/test_NEW.c

  • Compare two HTML files and invoke the type manager for HTML files.

    % xcleardiff –html my_new_source.html my_old_source.html