# gdiff(3)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

gdiff - Graphical file difference
%gdiff-com - Gdiff diff(1) command line

## SYNOPSIS

gdiff "version1" "version2"

`%gdiff-com` "string"; Default is "`diff -c -w`"

## DESCRIPTION

gdiff is a macro utility that facilitates the merging of two files (typically with different modification revisions). The changes between the revisions are hilighted with color, allowing modification regions and lines to be selected for the generation of a newer revision file, which might encompass selected modifications from each of the base revisions.

gdiff executes the diff(1) command with the command line set by the %gdiff-com(5) variable and the user supplied version1 and version2. The output is displayed in two buffer windows, side by side, and the differences in the lines are hilighted to show the changes. In addition the content of the two buffers is normalized such that both windows are aligned at the same line position, allowing the changes in the text to be viewed in both windows at the same time.

Whilst in gdiff view mode then both scroll bars (if visible) are locked, such that either scrolls BOTH windows at the same time. Other key commands are disabled, as are the menu interactions. The short cut keys are defined as follows:-

`esc h/A-h` - View the help page.

Invokes the display of a OSD help box, summarizing the interaction commands

`C-up` - Move to previous difference

Moves to the previous changed region above the current cursor position.

`C-down` - Move to next difference

Moves to the next changed region below the current cursor position.

`left mouse button`
`space`
`enter`
`r` - Select difference version

Selects the difference version of the currently selected window. The region is hilighted as the required region to be incorporated into the new revision.

`R` - Select neither version.

Marks both regions as not required.

`l` - Line select current version

Selects the current line from the region as being included, without including ALL of the region modifications.

`L` - Line select neither version

Discards lines from both revisions of the file.

`g` - Globally selects the current version.

Shortcut allows ALL modifications to the current side to be accepted. This is typically the fastest method to select all changes, minor region adjustment may then be performed on those regions which are inappropriately included by the selection.

`G` - Globally selects neither version.

Marks all regions as not being acceptable.

`C-x C-s` - Save current side

Saves the current window to the specified file, merging the selected changes between the two revisions. Note that the save only operates iff all hilighted changes have been selected.

`C-x C-w` - Save current side as

Same as Save current side except the user is prompted to enter a new filename to which the modifications are written.

`C-x k` - Exit graphical diff

Exits the gdiff utility.

## Hilighting

The hilighting within the windows is dependent upon the color scheme selected, in general the following hilights apply:-

normal text

No change

cyan/grey

Addition/removal of line(s)/region(s) between files.

yellow

Modification in line(s)/region(s).

green/red

Selected region, red or green is attributed to a selection for each window.

## NOTES

gdiff is a macro defined in `gdiff.emf`, inspired by the GNU utility of the same name gdiff(1)

diff(1) must be executable on the system before gdiff can function. The diff(1) invocation must include the context difference, which annotates the differences with a `+`, `-` or `!` markers. diff(1) is typically invoked with the options -c -w.

diff(1) is a standard utility on UNIX systems. For Windows 95/NT a version of GNU diff may be found at:

<ftp.winsite.com/ftp/pub/pc/winnt/misc/gnudiff.zip>

For MS-DOS users, a DJGPP port of GNU diff is also available on the net. A commercial version of diff is also available from MKS.

## SEE ALSO

compare-windows(2), compile(3), diff(1), gdiff(3f), xgrep(3), %xgrep-com(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>