|Comparing and Merging Files with GNU diff and patch|
by David MacKenzie, Paul Eggert, and Richard Stallman
Paperback (6"x9"), 120 pages
RRP £12.95 ($19.95)
"Well packaged... the quality of information is excellent" --- Linux User and Developer Magazine (Issue 36, Feb 2004) Get a printed copy>>>
7.2 Detailed Description of
diff3 Normal Format
Each hunk begins with a line marked ‘====’. Three-way hunks have plain ‘====’ lines, and two-way hunks have ‘1’, ‘2’, or ‘3’ appended to specify which of the three input files differ in that hunk. The hunks contain copies of two or three sets of input lines each preceded by one or two commands identifying where the lines came from.
Normally, two spaces precede each copy of an input line to distinguish
it from the commands. But with the
diff3 uses a tab instead of two spaces; this lines up
tabs correctly. See section 5.1 Preserving Tab Stop Alignment, for more information.
Commands take the following forms:
- This hunk appears after line l of file file, and contains no lines in that file. To edit this file to yield the other files, one must append hunk lines taken from the other files. For example, ‘1:11a’ means that the hunk follows line 11 in the first file and contains no lines from that file.
- This hunk contains the lines in the range r of file file. The range r is a comma-separated pair of line numbers, or just one number if the range is a singleton. To edit this file to yield the other files, one must change the specified lines to be the lines taken from the other files. For example, ‘2:11,13c’ means that the hunk contains lines 11 through 13 from the second file.
If the last line in a set of input lines is incomplete (see section 3 Incomplete Lines), it is distinguished on output from a full line by a following line that starts with ‘\’.
|ISBN 0954161750||Comparing and Merging Files with GNU diff and patch||See the print edition|