[darcs-users] Re: "replace" patch type

Tommy Pettersson ptp at lysator.liu.se
Sun Mar 28 18:37:07 UTC 2004

Samuel Tardieu wrote:
> I dislike the replace patch type -- I find it amusing at a first
> glance, but useless in real life.

It has found use in my life, but I can't for sure determine
if my life is real.  ;-)

>                                   Darcs would need full syntactic
> and semantic analyzers for many languages for it to be useful.

I think this is the right direction to move in, but not that
a full-blown analyzer is at all necessary.  A lot can be done
with as simple means as the token patterns of darcs replace.

I don't know what the "refactoring patch" mentioned in this
thread is, but I have some ideas of my own, and I suspect
the aim is similar.  Before I knew darcs, I was angered
by the insufficiency of the diff tools used in wikis when
comparing versions of wiki pages.  There are many ways to
construct better diffs, but they are not used.  wdiff is a
program that works with word context instead of line context,
and for formated text this makes the diffs useful rather then
useless when viewing them to find out what has changed.

With more advanced diff algorithms, a bit of context awareness,
and kind hinting from the user, darcs could really capture
"the meaning of a change" in a patch; no need for explicit
construction of move and replace patches etc.  Replaces
would be made as usual (with the editor, cscope or such).
Diff algorithms that detect replacements already exists.

I have poundered on an advanced diff program for wiki pages
that I will maybe write someday, and after I found out about
darcs I have also thought it could be useful for darcs too.
The existence of the replace patch in darcs and its pros and
cons interests me a lot.

Tommy Pettersson <ptp at lysator.liu.se>

More information about the darcs-users mailing list