FILEMERGE(1)

NAME
filemerge - window-based file comparison and merging program

SYNOPSIS
filemerge [ -a ancestor ] [ -b ] [ -l listfile ] [ -r ] [ leftfile [ rightfile [ outfile ] ] ]

DESCRIPTION
Filemerge is a window-based version of diff(1), for comparing and merging text files. It displays two files for side-by-side comparison, each in a read-only text-subwindow. Beneath them, an editing subwindow can be used to construct a merged version—one which contains selected lines from either or both input files, along with any additional edits you may make.

leftfile and rightfile are the files to be compared, and outfile is name of the file containing the merged version. If outfile is a directory, then the output is placed in the file outfile/leftfile. If outfile is omitted, the output file is named filemerge.out by default. If no filename arguments are given, you can enter them from within the tool itself.

OPTIONS

-a ancestor
    Compare both files with respect to ancestor. A minus-sign indicates lines that have been deleted relative to the ancestor. A plus-sign indicates lines added relative to the ancestor.

-b  Ignore leading blanks in comparisons.

-l listfile
    Process a list of filename pairs. With this option, leftfile and rightfile are the names of directories, and listfile contains a list of filenames that appear in both. filemerge compares the versions of each file between the two directories, and allows you to create a merged version (typically in the directory outfile). The SHIFT-Load command button, which is selected by holding the SHIFT key while clicking on the Load button, reads in the next pair named in the list. If listfile is -, then the list of files is read from the standard input.

-r  Readonly mode. Don't display the editing subwindow.

USAGE

The text in the editing subwindow (outfile) is initially the same as that in leftfile. To construct a merged version, you can directly edit the text of outfile with textedit commands, or you can change a selected difference to match rightfile (the one on the right) by clicking the Right button in the top panel.

  Differences
At any given time, one of the displayed ``differences'' is current. The current difference is indicated by emboldening the symbol adjacent to each line, and also by the notation ``i of n'' displayed in the control panel. Once a difference is current, you can use the Left and Right buttons to apply either the left-hand or the right-hand version of the text to outfile. The Next and Prev buttons select the next or previous difference, respectively.

  Property Sheet
You can customize filemerge using the property sheet to set or alter various display and control options. To bring up the property sheet, press the Props function key (typically L3) while the mouse is over any part of filemerge.

  Menus
There are pop-up menus associated with several of the control panel items, and a menu associated with the editing subwindow. The former provide to select any command function obtained with a modified mouse-button (such as SHIFT-Next ); the editing subwindow's menu has items that control the filename and directory location of the merged output. To bring up a menu, move the mouse-cursor to the command button, or to the editing subwindow, and hold down the right mouse-button. Select a desired menu item by releasing the mouse-button after moving the cursor on top of it.

  Command Buttons

Next
    Make the next difference current. The subwindow scrolls, if necessary, to display it.

    SHIFT-Next 12 Make the first difference current. (Also a menu item from the Next menu.)

Prev
    Make the previous difference current.

    SHIFT-Prev 12 Make the last difference current. (Also a menu item from the Prev menu.)

Right
    Apply right-hand version of the current difference to outfile. If autoadvance is in effect, advance to the next difference.

    SHIFT-Right 12 Apply the right-hand version and advance to the next difference, unless autoadvance is in effect. (Also a menu item from the Right menu.)

CTRL-Right
    Apply the right-hand version for the current difference, and for all subsequent differences up to the end of the file.

Left
    Apply the left-hand version of the current difference.

Undo
    Undo the last Right or Left operation. You can undo up to 100 stacked operations. You can't undo an undo.

    SHIFT-Undo 12 Undo all the operations since the last Load, or the last 100 operations.

Scroll-Lock
    When in effect, the three text-subwindows scroll in unison. Otherwise each subwindow scrolls independently.

i of n
    The number of the current difference, i, out of n detected differences. Popping up a menu on this item allows you to jump to a selected difference.

Load
    Load the files whose names appear by the prompts File1: and File2:.

    SHIFT-Load 12 When the -l option is used, load the files from the directories shown in File1 and File2 corresponding to the next name in the list (taken from the listfile argument).

Done
    Save outfile and close the tool. The name used to save the file appears in the namestripe, in the same fashion as textedit.

    SHIFT-Done 12 Save without closing. You can also save the merged version using the Save item in the editing subwindow's menu.

Quit
    Exit the tool. You must explictly save your merged outfile, either with the Done button or the Save item in the editing subwindow's menu.

  Properties

Hitting the L3 function key brings up a property sheet that controls several filemerge parameters. The information in the property sheet is stored in the file ~/.filemergerc. The property panel items have the following meanings:

Apply
    Any changes you have made to the property sheet will now take effect.

Reset
    reset the property sheet to the state it had at the time of the last Apply.

Done
    Close the property sheet.

autoadvance
    Advance to the next difference after each Left or Right operation.

Toplines
    number of lines in the top two subwindows

Bottomlines
    number of lines in the bottom subwindow

Columns
    number of columns in the left (and also right) subwindow

FILES
~/.filemergerc
    file storing property sheet information

SEE ALSO
diff(1), sdiff(1), textedit(1)

BUGS

Using the Find function key causes the subwindows to get out of sync for scrolling. To resync them, turn Scroll-Lock first off, and then on.