TITLE: The Theory of Patches AUTHOR: Eugene Wallingford DATE: December 03, 2004 10:11 AM DESC: A confluence between patterns, refactoring, and version control tools ----- BODY: Recently, I ran across an interesting article by David Roundy called The Theory of Patches, which is actually part of the manual for Darcs, a version-control alternative to CVS and the like. Darcs uses an inductive definition to define the state of a software artifact in the repository:
So how does one define a tree, or the context of a patch? The simplest way to define a tree is as the result of a series of patches applied to the empty tree. Thus, the context of a patch consists of the set of patches that precede it.Starting with this definition, Roundy goes on to develop a set of light theorems about patches, their composition, and their merging. Apparently these theorems guide the design and implementation of Darcs. (I haven't read that far.) The reason I found this interesting was the parallel between repeated application of patches to an empty tree and