From owner-freebsd-hackers Sat Mar 10 18:13: 5 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 8247937B718 for ; Sat, 10 Mar 2001 18:12:58 -0800 (PST) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id DAA32861; Sun, 11 Mar 2001 03:10:24 +0100 (CET) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Poul-Henning Kamp Cc: Jordan Hubbard , mwlucas@blackhelicopters.org, hackers@FreeBSD.ORG Subject: Re: context or unified diffs in PRs? References: <40511.984257440@critter> From: Dag-Erling Smorgrav Date: 11 Mar 2001 03:10:24 +0100 In-Reply-To: Poul-Henning Kamp's message of "Sat, 10 Mar 2001 21:50:40 +0100" Message-ID: Lines: 93 User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Poul-Henning Kamp writes: > In message <20010310124052O.jkh@osd.bsdi.com>, 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 - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message