Newsgroups: comp.sources.misc
subject: v14i070: Unified context diff tools
from: davison@dri.com (Wayne Davison)
Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)

Posting-number: Volume 14, Issue 70
Submitted-by: davison@dri.com (Wayne Davison)
Archive-name: unidiff/part01

[A brief excerpt from the PROPAGANDA file:]

I've created a new context diff format that combines the old and new hunks into
one unified hunk.  The result?  The unified context diff, or "unidiff."

Posting your patch using a unidiff will usually cut its size down by around
25% (I've seen from 12% to 48%, depending on how many redundant context lines
are removed).  Even if the diffs are generated with only 2 lines of context,
the savings still average around 20%.

Keep in mind that *no information is lost* by the conversion process.  Only
the redundancy of having multiple identical context lines.  [...]

I've included:
   o	a patch to make gnudiff (v1.14) generate a unidiff.
   o	a patch to make patch (patchlevel 12) accept a unidiff.
   o	a versatile program called "unify" that can translate from a context
	diff (new- or old-style) into a unidiff, and from a unidiff into a
	true new-style context diff.
   o	a man page for unify.
   o	a 1.3k bandaid called "unipatch" that translates a unidiff into a
	context diff format that older versions of patch can understand.
	(It outputs a slightly degenerate form of a context diff (no '!'s)
	but it works great with patch.)
   o	a Makefile to get you going quickly.
-- 
 \  /| / /|\/ /| /(_)     Wayne Davison
(_)/ |/ /\|/ / |/  \      davison@dri.com
   (W   A  Y   N   e)     ...!uunet!drivax!davison

