home *** CD-ROM | disk | FTP | other *** search
- hdiff [-cdmvw] oldfile newfile
-
- Source file compare program.
- Yet another source compare program like diff. This one reports moved lines,
- not delete/insert as the UNIX diff does. The h is in honor of Paul Heckel,
- the guy who first wrote about this algorithm in CACM July 1978.
-
- One of c,d, or m should be used to adjust the internal algorithm.
- Currently I am playing with the algorithm.
-
- Switches
- -c = use a "count between the start of the other move block and
- the first line in the other file which matched this move
- block" to determine moved blocks [DEFAULT]
- -d = use a "drop" or relative slope to determine moved blocks
- -m = use "mononotonically increasing by one" to determine moved blocks
- -v = verbose (debugging)
- -w = compress white space only on each line before comparison,
- and remove leading white space (remwhite -a option).
-
- (see CACM, April 78, "A Technique for Isolating Differences Between Files",
- by Paul Heckel).
-
- Output:
- The output is identical in meaning to the output from UNIX diff,
- except that a "move" command is present here, but not in diff.
-
- DELETES
- -------
- old d new // Single line delete - Old line number 'old' is
- // deleted after new line numbered 'new'
- startold,endold d new // Block line delete - Old block of lines 'startold'
- // to 'endold' are deleted after new line number 'new'
-
- INSERTS
- -------
- old a new // After old line number 'old' is new line number 'new'
- old a startnew,endnew // After old line number 'old', new lines numbered
- // 'startnew' to 'endnew'
-
- CHANGES
- -------
- old c new // Change one line to one new line. The old line
- // numbered 'old' becomes new line numbered 'new'
- old c startnew,endnew // Change one line to a block of lines. Old line
- // numbered 'old' becomes the new set of lines.
- startold,endold c new // Change a block of old lines to one new line.
- startold,endold c startnew,endnew // Change a block of lines to
- // a different block of lines.
-
- MOVES
- -----
- old m new // Old line number 'old' is moved to new line
- // number 'new'
- startold,endold m startnew,endnew // The old block of lines have been moved
- // and the old line numbers have changed.
-
-
- For DELETES, INSERTS, and CHANGES (but not MOVES) the old line and new lines
- are displayed as follows (same as the UNIX diff):
- < old line
- > new line
-
- BUGS:
- Hdiff is limited to files with at most 5000 lines per file.
- To fix, recompile hdiff.c with a larger MAXLINES #define.
-