[darcs-users] Doubts about commuteFilepatches

Iago Abal iago.abal at gmail.com
Wed Nov 17 16:38:27 UTC 2010


Am I only that is getting worried seeing that Darcs code have many "things
hard to understand" that are not documented nor are understood even by some
(all?) of its current developers... ?

On Wed, Nov 17, 2010 at 4:32 PM, Iago Abal <iago.abal at gmail.com> wrote:

> What I can do is to relax the facts I have impose to Hunks in my Alloy
> model and check some properties about how commuteHunk works without that
> assumptions (for instance, remove my assumption that not empty old or not
> empty new).
>
> Question 1: Darcs diff could generate non-sensible hunks? That will be a
> bug, I think.
>
> Though thinking about it very quickly....
> Let me call Hunk f l [] [] "stupid-hunk": A stupid-hunk h is almost
> equivalent to the Identity patch (but it requires h.file to exist, and line
> h.line to be in "in bounds"). I think could be easily proved that a
> stupid-hunk will always commute with another Hunk. Since modify the line of
> a stupid-hunk have no effect, and since -h.new+h.old=-h.old+h.new=0 I think
> commuteHunk is well behaved for stupid-Hunks.
>
> (stupid-Hunk should only be offensive for the Hunk!)
>
> On Wed, Nov 17, 2010 at 3:52 PM, Eric Kow <kowey at darcs.net> wrote:
>
>> On Wed, Oct 27, 2010 at 12:40:00 +0100, Iago Abal wrote:
>> > commuteFP f (Hunk line1 [] [] :< p2) = seq f $ Succeeded (FP f
>> > > (unsafeCoerceP p2) :< FP f (Hunk line1 [] []))
>> > >
>> > commuteFP f (p2 :< Hunk line1 [] []) = seq f $ Succeeded (FP f (Hunk
>> line1
>> > > [] []) :< FP f (unsafeCoerceP p2))ç
>> > >
>> > ...
>>
>> > Why do you pattern match agains Hunk patches with empty "old" and "new"
>> > content? Are they sensible?
>>
>> Huh.  That looks weird.  I only have more questions :-)
>>
>> Would you mind looking at commuteHunk and showing what the result would
>> be in the 5 cases with and without this commuteFP case?  (In other
>> words, falling into the guards [where possible] with one of the hunks
>> being empty in this fashion).
>>
>> It doesn't look like the result would be the same (no line number
>> shifting).
>>
>> Are "empty" hunks like this really supposed to just float past?
>> How do they generated?
>>
>> --
>> Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
>> For a faster response, try +44 (0)1273 64 2905 or
>> xmpp:kowey at jabber.fr <xmpp%3Akowey at jabber.fr> (Jabber or Google Talk
>> only)
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.10 (GNU/Linux)
>>
>> iEYEARECAAYFAkzj+kwACgkQBUrOwgisBPn26QCgsgvVeBeVvFZyqcnTrYInVA/R
>> 1hkAn0DYeSWeF560E/a3EPkEnPtIHPPe
>> =MWcV
>> -----END PGP SIGNATURE-----
>>
>>
>
>
> --
> Iago Abal Rivas
>



-- 
Iago Abal Rivas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20101117/38012595/attachment-0001.html>


More information about the darcs-users mailing list