UNIX diff Context Report Example

The two files compared are shown below.

First File Second File
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Eustace, a pointy-eared hippopotamus, was
scampering across a summer meadow one day
when he suddenly came across a stream.

Sitting on a rock in the middle of the
stream was a small green frog, basking in the
afternoon sunshine.

"Hello small green frog!", said Eustace. "What
are you doing there?"

Froggy didn't answer, so Eustace trod on him
and wandered off into the nearby forest to look
for wild onions.
Eustace, a pointy-eared hippopotamus, was
scampering across a summer meadow one day
when he suddenly came across a stream.

Eustace almost fell into the stream, but
skidded to a halt just in time.

Sitting on a rock in the middle of the
stream was a small blue frog, basking in the
afternoon sunshine.

"Hello small blue frog!", said Eustace. "What
are you doing there?"

The context-format report created by Merge will look like the one shown below. For this example, two lines of unchanged context were specified using the relevant report option.

Context Report Explanation
*** E:\temp\Eustace1.txt	Sat Apr 28 00:51:11 2001
--- E:\temp\Eustace2.txt	Sat Apr 28 00:51:18 2001
The first two lines list the two files that were compared. Throughout the report, asterisks represent the first file and hyphens represent the second file. The filenames are followed by a (local time) timestamp that shows their last-modified dates and times.
***************
*** 3,14 ****
 when he suddenly came across a stream.

 Sitting on a rock in the middle of the
! stream was a small green frog, basking in the
 afternoon sunshine.

! "Hello small green frog!", said Eustace. "What
 are you doing there?"
-
- Froggy didn't answer, so Eustace trod on him
- and wandered off into the nearby forest to look
- for wild onions.

This block shows changed and removed lines in the first file. Changes are surrounded by unchanged context lines. The numbers at the start of the block show that the block starts at line 3 in the first file and ends at line 14.

If a change and its surrounding context lines overlap another change and its surrounding context lines, the changes are combined into one block (as in this example).

Changed lines are prefixed with an exclamation mark. Removed lines are prefixed with a hyphen. Unchanged lines have no prefix character.

--- 3,13 ----
 when he suddenly came across a stream.

+ Eustace almost fell into the stream, but
+ skidded to a halt just in time.
+
 Sitting on a rock in the middle of the
! stream was a small blue frog, basking in the
 afternoon sunshine.

! "Hello small blue frog!", said Eustace. "What
 are you doing there?"

This block shows changed and inserted lines in the second file. Changed lines are prefixed with an exclamation mark. Inserted lines are prefixed with a plus sign. Unchanged lines have no prefix character.