Poul-Henning Kamp <[EMAIL PROTECTED]> writes:
> In message <[EMAIL PROTECTED]>, Jordan Hubbard writes:
> > Both context and unidiffs show surrounding context, it's simply the
> > meta-data format which changes. [...]
> I repeat, with added emphasis: [...]
You're both either slightly off, or not expressing yourselves clearly.
Context diffs are called that because they show context around the
changes. Unified diffs are also context diffs, but they're unified
because they show removed and added lines in a single block instead of
separate blocks:
des@flood ~% diff -c old new
*** old Sun Mar 11 03:04:43 2001
--- new Sun Mar 11 03:05:02 2001
***************
*** 1,7 ****
one
two
three
! fore
five
six
seven
--- 1,7 ----
one
two
three
! four
five
six
seven
des@flood ~% diff -u old new
--- old Sun Mar 11 03:04:43 2001
+++ new Sun Mar 11 03:05:02 2001
@@ -1,7 +1,7 @@
one
two
three
-fore
+four
five
six
seven
Unified diffs are almost always easier to read, because you don't have
to move your eyes back and forth so much. Context diffs are easier to
read in the rare cases where a large nearly-contiguous block of text
has changed and diff(1) screws up because it finds that some of lines
in the new text are identical to some of the lines in the old text,
while in fact they're not related:
des@flood ~% diff -c old new
*** old Sun Mar 11 03:07:31 2001
--- new Sun Mar 11 03:08:08 2001
***************
*** 1,7 ****
! the
little
! horse
! jumped
! over
! the
! fence
--- 1,7 ----
! three
! ducks
! swim
! in
! a
little
! pond
des@flood ~% diff -u old new
--- old Sun Mar 11 03:07:31 2001
+++ new Sun Mar 11 03:08:08 2001
@@ -1,7 +1,7 @@
-the
+three
+ducks
+swim
+in
+a
little
-horse
-jumped
-over
-the
-fence
+pond
DES
--
Dag-Erling Smorgrav - [EMAIL PROTECTED]
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message