[darcs-users] questions on patch theory
David Roundy
droundy at abridgegame.org
Mon Sep 22 11:56:56 UTC 2003
On Sun, Sep 21, 2003 at 06:18:08PM -0400, Mirian Crzig Lennox wrote:
> What I mean by approaching zero distortion is approaching a
> representation which precisely defines the user's unchanging intent.
> In a hypothetical English-language patch format, we could define a
> patch as, for example, "change the return type of the function 'foo'
> to 'void'". A patch like that would commute without distortion with
> any other patch except one that changed that function's name. So, to
> address that case, we could change that patch from referring to the
> function by what it does, rather than what it is named. But then,
> what if that changes in a way that we haven't anticipated? So, even
> with a specification language as powerful as English, and an intimate
> knowledge of the file's syntax, we cannot achieve zero distortion
> across the board. On the other hand, it is always possible to define
> a finite state grammar with zero distortion for some finite set of
> changes.
Yes, that is the idea. There is a tradeoff between complexity of the
change description, which would lead to user error if not implementation
bugs, and the zero-distortion goal.
As an example, I've plans to eventually include a tabbing patch, which
would take a given region and add (or remove) the same header to each line.
This would allow you to fix the indentation of a function (preferably in a
language like C where indentation doesn't affect its meaning) while still
commuting with modifications to the function itself. This wouldn't be zero
distortion, since commutation with insertion into the function would be
non-trivial, but it would get just a tad closer. Although, when I think
about it, the real enemy is not distortion, but failure to commute, which
leads to merge conflicts.
My plan for post-darcs-1.0 is to work on a bunch of new patch types. The
pre-1.0 plan is to get everything working with the patch types we've
already got. Right now, that meands tracking down a memory leak. :(
--
David Roundy
http://www.abridgegame.org
More information about the darcs-users
mailing list