[darcs-users] What if darcs is generating too inclusive of hunks?

Marnix Klooster marnix.klooster at gmail.com
Fri Nov 10 17:04:35 UTC 2006


On 10-11-06 17:41, Brian Smith wrote:
> On 11/9/06, *Yuval Kogman* <nothingmuch at woobling.org 
> <mailto:nothingmuch at woobling.org>> wrote:

[snip]

>     The real solution is to darcs get the repo to a /tmp dir, edit
>     the parts you want, and record. then you can  copy your file to a
>     new place in your original working dir, revert, pull from the tmp
>     repo, and then move the file over the updated one, and record the
>     rest of the change.
> 
>     It's cumbersome, but I do this often, I have the same problem as you
>     ;-)
> 
> 
> That means at least three of us have recognized that the diff mechanism 
> is not working correctly. Let's collect some examples and file a bug.

For the record: there is no such thing as a correct diff mechanism. 
Diffs can usually be made in lots of different ways, even minimal diffs.

For example: if I have a function f like so

-----------------------
function f()
{
}
-----------------------

and I append a new function g

-----------------------

function g()
{
}
-----------------------

then the diff usually will be

-----------------------
}

function g()
{
-----------------------

which is not a nice diff (for someone who knows a programming language), 
but it is minimal.

Moral: creating 'nice' diffs is an arcane art, and not a matter of being 
correct or not (or even minimal or not).

(That said, it would be nice if the diff algorithm in darcs gave nicer 
results in more cases.  And/or if you can interactively influence the 
algorithm.)

Groetjes,
  <><
Marnix




More information about the darcs-users mailing list