XDIFF(1L) XDIFF(1L)
xdiff - X11/Motif based file comparator and merge tool.
xdiff [-Dwib] [-N stdin name] path1 path2
xdiff is a graphical browser for viewing the differences between two
files and can be used to produce a merged version. The text of the two
files are presented side by side with their differences highlighted for
easy identification.
The two paths supplied on the command line identify the files to be
compared. One of the two paths must be a file. The other may be one of
three things. Another file, a directory, in which case the last
component of the file name will be appended to the directory to form the
other file name, or a '-', in which case the input for that path will be
read from standard input.
OPTIONS FOR XDIFF
-N When input is read from stdin this option specifies the string to
use in place of it's name in the title bar. If not specified the
string "<stdin>" is used.
-D If there are no differences then exit quietly with exit code of 0.
-w Passed on to diff(1). Ignore whitespace when comparing the two
files.
-b Passed on to diff(1). Ignore trailing blanks when comparing the two
files.
-i Passed on to diff(1). Ignore case when comparing the two files.
- Not really an option. Use stdin as one of the files. See above.
The xdiff window is divided into 4 main areas. These are, the menu bar at
the top of the window, a message line just below it, an overview area on
the right side of the window and a text area occupying the remainder. The
text area is further divided into two text windows, one for each file, a
vertical slider between them and a horizontal slider underneath each text
area.
xdiff uses diff(1) to determine the differences between the two files.
The text of the two files is displayed in two scrollable windows in the
main area of the window. Differences are highlighted using different
colours for the foreground and background. These may be specified by the
user as described below in the section on user preferences. A vertical
slider separates the two text areas and controls the vertical positioning
of both text areas simultaneously. The size of the thumb of the slider
Page 1
XDIFF(1L) XDIFF(1L)
is scalled to represent the amount of text visible in the windows.
xdiff can be used to merge the differences from the two files into third.
To select the desired differences the user interacts as follows. To write
this merged version see the section of the File menu.
With the pointer in the left window and pressing the left button the
cursor line moves to the line under the pointer. If this line is in a
difference region then the the left region is selected. Similarly the
differences in the right window may be selected by pressing the left
button on the difference in the right window.
Pressing the middle button with the pointer in either the left or right
windows will move the cursor line to the line under the pointer. If this
is within a difference region then a selection of only the cursor line is
made. This allows a finer level of selection of which text will appear
in the merged output.
Holding the Shift key will cause the region or line, as described above,
to have it's selection removed.
Pressing the right button while in either the left or right windows will
post a popup menu. This popup's methods are to move to other difference
regions. Accelerators may be attached to provide quick navigation using
the keyboard.
Next Difference
Go to the first line of the next difference region.
Previous Difference
Go to the last line of the previous difference region.
Next Unselected
Go the the first line of the next difference region that is still
unselected.
Previous Unselected
Go the the last line of the previous difference region that is still
unselected.
The overview window appears at the right side of the xdiff window. It's
purpose is to show graphically the number, location and size of the
differences between the two files. This display consists of two columns
representing the files and their differences and an area in between where
lines indicate where the differences occur with respect to the other
file. A small arrow is shown in each column and represents the position
of the cursor line in that file. The relative lengths of the files are
shown by comparing the lengths of the two columns.
Pressing any button while the pointer is in the overview area will move
the cursor line to the position in the file indicated by the pointer
Page 2
XDIFF(1L) XDIFF(1L)
position. If the pointer is in the left half of the overview window the
line will be determined from the left file and from the right file if the
pointer is in the right half. The cursor line will then be displayed in
the center of the text windows.
xdiff has a menu bar consisting of six buttons. These are listed below
and described in more detail in the sections that follow.
File
Contains output commands and exit.
Edit
Contains searching and cursor movement functions.
Global
Contains functions that apply to the entire file.
Region
Contains functions that apply to a single difference region.
Line
Contains functions that apply to a single difference line.
Help
Interface to access the online help.
This menu is used to save the merged text to a file and to exit xdiff.
Before a save can be performed all differenced must have a selection. If
not, an error message is displayed in the message line and the cursor
line is moved to the first line which does not have a selection. After a
save to a file, a message will be displayed in the message line to
indicate the status of the save. If the resource confirmWrite is set to
True then a confirmation dialog is presented before a save allowing the
user to confirm the write or cancel the operation. The default for the
confirmWrite resource is True.
If you attempt to save to the left file or the right file when that file
has been read from the standard input xdiff will write the output to
standard output. This allows xdiff to be used in a filter chain like all
well behaved Unix utilities.
Save as Right
Short cut to save the merged text to the file on the right.
Save as Left
Short cut to save the merged text to the file on the left.
Save As ...
Save As will present the user with the Motif file selection box. If
the user presses the OK button then the merged text will be written
Page 3
XDIFF(1L) XDIFF(1L)
to the specified file subject to the confirmation described above.
When writing the regions of common text using Save As the text from
the left file is used. This may yeild surprises if the -w -b -i
flags are used. Although the text is indicated as being the same it
may not be.
Exit
Leave xdiff unconditionally.
This menu contains functions for search and cursor movement.
Search ...
Search will present a dialog box containing an editable text field
and a Search and Cancel button. The user may enter a regular
expression in the text field to specify the search pattern.
Pressing Enter or pressing the Search button will initiate the
search on all text in both files. A small diamond will appear in the
overview area for each line that matches the search pattern. To move
to a match you may click on one of the diamonds in the overview area
or use the Search Next or Search Previous buttons from this menu.
Search Next
Move the cursor from its current position to the next match from
either file. If there are no more matches then it the cursor is
positioned at the bottom.
Search Previous
Move the cursor from its current position to the previous match from
either file. If there are no more matches then it the cursor is
positioned at the top.
Scroll Down
The cursor line is moved down half the number of visible lines and
then that line is centered in the window if possible. The
functionality of this and the following buttons in this menu are
really not required since it can all be done using the scroll bars.
They are included so that accelerators may be added. In this way the
operation of xdiff can be completely controlled from the keyboard.
Scroll Up
The cursor line is moved up half the number of visible lines and
then that line is centered in the window if possible.
Cursor Down
The cursor line is moved to the next line. That line is the centered
in the window if possible. This gives the effect of the text
scrolling under a stationary cursor.
Page 4
XDIFF(1L) XDIFF(1L)
Cursor Up
The cursor line moves as above but in the other direction.
Cursor Top
The cursor line is set to the first line. That line is displayed at
the top of the window.
Cursor Bottom
The cursor line is set to the last line. That line is displayed at
the bottom of the window of possible.
Redo Diff
The files are diff'd again. Any selection information is lost. The
intention is that you can hand-edit one of the files and then rediff.
This can provide a major improvement in ease of merging
files.
This menu contains operation that affect the entire file.
Select Left
Selects all the difference regions from the left file.
Select Right
Selects all the difference regions from the right file.
Select Neither
All regions from both files are unselected. Only common text will be
included in the merged output.
Unselect
Removes all selections that have been made.
Tabs 4
Specifies that tabs should be expanded to 4 spaces.
Tabs 8
Specifies that tabs should be expanded to 8 spaces.
Line Numbers
Each line of text will be prefixed with the line number from its
file. Regions of absent text will not have a line number.
The functions of the Region Menu use the location of the cursor line to
specify the region for which the function is to be performed. These
functions will only work when the cursor line is on a difference.
Select Right
The entire difference region from the right file is selected.
Page 5
XDIFF(1L) XDIFF(1L)
Select Left
The entire difference region from the left file is selected.
Select Neither
Both the left and the right regions are unselected. Neither region
will be included in the merged output.
Unselect
Any previous selection made to this region will be removed.
Split Right
In the case when the text has changed between the left and the right
files and it is desired to have both differences appear in the
merged output split right can be used to create two differences so
that each can then be selected individually. Split right will list
the text from the right file first and then the text from the left
file. Any selection that has been previously made to the region will
be applied to both regions after the split.
Split Left
Same as Split Right except that the text from the left file is
listed first.
This menu's functions use the location of the cursor line to specify the
line for which the operation is to be performed. These functions will
only work when the cursor line is on a difference.
Select Right
Only the cursor line is selected from the right file.
Select Left
Only the cursor line is selected from the left file.
Select Neither
The cursor line for both sides are unselected and so neither line
will be included in the merged output.
Unselect
Any previous selection made to this line will be removed.
On Context
To obtain help for any widget in the main window. Selecting the help
on context button will cause the cursor to change to a question
mark. Move this cursor to any of the widgets and click. A help
window will appear to describe the widget and it interactions.
About xdiff
Provides general information about xdiff.
Page 6
XDIFF(1L) XDIFF(1L)
The differences obtained from diff(1) can be classified into 4 types.
Common
Common Text which is present in both files.
Only
Only text is text that appears only in one file.
Absent
When text is missing from a file the void is called Absent. This
always accompanies Only text.
Changed
Text which has been changed between the files is called Changed
Text.
Unselected text will use the types above. Once a selection has been made
the following types will apply.
Selected
When the user has selected one of the two sides of a difference then
that will be selected the other side will become deleted.
Deleted
This text is not desired in the merged output.
These names are used to form X11 resources names to determine the users
preferences.
Each of these categories may have different colours for foreground and
background. They may also have a different font. Any unspecified fonts
will default to the font for fontCommon. To specify the foreground
resources name prefix the name with 'fgc' the background is specified by
prefixing the name with 'bgc'. To specify the font, prefix with 'font'.
From the app-defaults file the Common text is specified with.
*fontCommon: *-clean-medium-r-normal-*-14-*
*fgcCommon: black
*bgcCommon: grey
The cursor colour may be specified using the resource 'cursorColour' This
colour is used to outline the current line in the text windows and the
outline of the triangular indicator in the overview area. Lines that
match the pattern specified in the search window may be outlined in a
different colour to indicate the match. The resource used to specify
this is 'matchColour' if not specified the cursorColour is used.
Page 7
XDIFF(1L) XDIFF(1L)
xdiff uses a temporary file when reading from stdin. This file will be
located in $TMPDIR if it is defined otherwise it will be located in
/usr/tmp. The file name will be of the form xdiffXXXXXX.
Application defaults for xdiff can be found in /usr/lib/X11/appdefaults/Xdiff.
The default accelerator keys used by xdiff have changed from the original
gdiff accelerators to be consistent with those used in other SGI desktop
applications.
gdiff(1), diff(1).
Rudy Wortel <[email protected]>.
Inspired by gdiff written by Andrew C. Myers.
PPPPaaaaggggeeee 8888 [ Back ]
|