[darcs-users] Doubts about commuteFilepatches

Iago Abal iago.abal at gmail.com
Tue Nov 23 12:37:07 UTC 2010


Could stupid-hunks be the result of rollback and colescing of patches?

Suppose we have some hunk p, if we rollback it pp^ and then we ask for
colescing(pp^), could this produce an stupid-hunk?

On Mon, Nov 22, 2010 at 11:48 AM, Iago Abal <iago.abal at gmail.com> wrote:

> On Mon, Nov 22, 2010 at 11:00 AM, Eric Kow <kowey at darcs.net> wrote:
>
>> On Wed, Nov 17, 2010 at 16:32:54 +0000, Iago Abal wrote:
>> > Question 1: Darcs diff could generate non-sensible hunks? That will be a
>> > bug, I think.
>>
>> It might not come from the differ.  I wonder what else might generate
>> hunks. Could this somehow result from operations like patch coalescing,
>> or maybe generating the primitives used during conflict marking?  There
>> may be other sources still.
>>
>> If so, it seems like a quick&dirty fix (instead of fix what produces
> stupid-hunks just check for them in commute). Would be interesting to know
> what was the comment of the author when s/he record that patch.
>
>> > 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.
>>
>> Well I can see that the stupid hunks always commute past. I guess I'm
>> vaguely concerned that there's some sort of patch theory property that
>> gets violated by these odd indices, or that one day we'll be trying to
>> apply a stupid hunk to line 42 of a now 10 line file.  Sure we could
>> catch the stupid hunk case and systematically no-op (need to check if
>> we do), but it does look weird.
>>
> Are you worried because this stupid-hunks are created (e.g. by colesce)
> with invalid line numbers? Or are you worried because the use of commute
> could lead to invalid (out of range) line numbers?
>
>>
>> --
>> 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)
>>
>> iEYEARECAAYFAkzqTTgACgkQBUrOwgisBPmqyQCfS8pIScKLjKWdtspSyCwQelh/
>> GugAoLdbdfzpcqF69eClzasBRNE6vhBl
>> =EPDz
>> -----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/20101123/73335c50/attachment.html>


More information about the darcs-users mailing list