| Comparing and Merging Files with GNU diff and patch by David MacKenzie, Paul Eggert, and Richard Stallman Paperback (6"x9"), 120 pages ISBN 0954161750 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>>> |
2.3.2.1 Detailed Description of Unified Format
The unified output format starts with a two-line header, which looks like this:
--- from-file from-file-modification-time +++ to-file to-file-modification-time
The time stamp looks like ‘2002-02-21 23:30:39.942229878 -0800’ to indicate the date, time with fractional seconds, and time zone.
You can change the header's content with the
--label=label option; see See section 2.3.4 Showing Alternate File Names.
Next come one or more hunks of differences; each hunk shows one area where the files differ. Unified format hunks look like this:
@@ from-file-range to-file-range @@ line-from-either-file line-from-either-file...
The lines common to both files begin with a space character. The lines that actually differ between the two files have one of the following indicator characters in the left print column:
- ‘+’
- A line was added here to the first file.
- ‘-’
- A line was removed here from the first file.
| ISBN 0954161750 | Comparing and Merging Files with GNU diff and patch | See the print edition |