# IRC log for #darcs-theory, 2009-04-11

All times shown according to UTC.

Time Nick Message
09:33 arjanb joined #darcs-theory
10:22 kowey joined #darcs-theory
15:37 gal_bolle joined #darcs-theory
20:11 DanielC joined #darcs-theory
20:12 DanielC Is this the right place to ask questions for the patch theory documentation?
20:27 Heffalump yes
20:29 DanielC Thanks ok, arjanb helped me in #darcs.
21:15 DanielC Question about patch theory: When darcs commutes patches AB = B'A', how does it figure out that patch B' does "the same thing" as B? In which sense do you decide that B and B' are somehow related?
21:16 Heffalump that's down to the definition of the primitive patch commutation
21:17 Heffalump as long as your commutation satisfies the various (not well-documented) laws, it's ok
21:17 Heffalump though no doubt you could satisfy them in silly ways as well as sensible ones
21:18 DanielC Yeah, that's what I was thinking. How do you distinguish sensible from silly "commutations" (e.g. let B' = A and A' = B).
21:18 DanielC "Look ma! I commuted them"
21:18 Heffalump using that one as a general rule is disallowed by the laws about commuting identity patches
21:18 Heffalump you'd expect idA <-> Aid
21:19 DanielC Yeah, but still, how do you decide that A' is even related to A? (much less "does the same thing").
21:20 Heffalump well, that's down to you as the author of the patch type
21:20 Heffalump though remember that you have to be able to commute back, so you can't throw away information
21:21 DanielC So, I guess you have to make commutation rules specifically for each pair of primitive patches. Is that how you do it?
21:22 DanielC e.g. a rule for commuting two hunks, a rule for commuting a hunk and a file rename, etc.
21:22 arjanb right
21:22 Igloo You can prove it makes sense if you start from a lower level, i.e. what Andres and Wouter were doing
21:23 DanielC I think I see how it works now.
21:24 DanielC I can see how commutation is more straight forward if you only look at pairs of primitive patches.
21:25 DanielC Question: Does patch theory mean that Darcs can merge better than other SCMs?
21:25 arjanb better in what sense?
21:27 DanielC Is there a sense in which Darcs is better and a sense in which it's worse?  I'm too new at patch theory to give a meaningful definition of "better".
21:27 DanielC More accurate? More reliable?
21:30 arjanb darcs has properties like any order of merging a set of patches gives the same result
21:31 DanielC That's a cool feature. I'll put that one in the doc.
21:33 arjanb but darcs might not be the best in avoiding conflicts
21:34 DanielC Why would it be worse? The idea looks sound to me.
21:38 arjanb you can't always combine mathematical soundness with using human fuzzines to avoid merge conflicts
21:39 DanielC ok
21:40 Heffalump the requirement that any commute be uniquely invertible means you can't do some merges you would otherwise think fine
21:40 arjanb for example two patches insert a line at the same spot, darcs will give a conflict while others might insert then in the order of merging
21:40 DanielC Oh, does this mean that other SCMs might not give you the same tree if you apply patches in a different order?
21:40 Heffalump DanielC: right.
21:40 DanielC Interesting. I didn't know that.
21:41 Heffalump one of the neat properties of darcs is that a merge doesn't generate a fresh commit, because it doesn't need to because of the "in any order" property
21:41 Heffalump DanielC: I don't know of specific examples. It depends on how they deal with situations like the one arjanb describes.
21:41 Heffalump The invertibility property is crucial for cherry-picking. I suspect that the other DVCSes that support cherry picking can be "broken" by using it heavily.
21:41 DanielC Two patches that insert the same line in the same spot could very easily conflict. I would hope the SCM would catch that.
21:42 DanielC e.g.:   #define NUM_FUNCTIONS 3
21:42 Heffalump yeah, I suspect most/all don't allow that
21:42 Heffalump but there's subtler cases
21:45 DanielC The invertibility property confuses me. Is there any possible change that is *not* invertible? I can't think of any.
21:45 Heffalump file copy is a good example of a tricky one
21:46 Heffalump but to a large extent invertibility just guides the way you represent changes - for example when removing content the content being removed has to be listed in the patch
21:47 DanielC Ah. So you mean that you should be able to figure out the invest by just looking at the patch. So a patch that simply says "I deleted this file" is not invertible.
21:47 Heffalump right
21:47 DanielC s/what the inverse is/
21:49 DanielC I would have expected that other SCMs would keep track of deleted information. It seems easy enough and obvious enough. One of the most basic things you want from an SCM is that it show you what the source tree looked like last year.
21:49 arjanb the interesting part of inverses is how they relate commutation with merging
21:49 Heffalump sure, but they don't have a concept of a patch to deal with
21:50 Heffalump typically they just efficiently store the old version of the tree
21:50 Heffalump it amounts to the same information, but the representation matters
21:51 DanielC Ok. Its like saying that darcs sees a tree as a group of patches and (say) CVS sees a patch as the difference between two trees.
21:52 Heffalump right
21:52 Heffalump so the key difference between darcs and other DVCSes is that darcs bakes in the merge algorithm into the definition of a patch type
21:53 Heffalump whereas most other DVCSes can do what they like at merge time, because they aren't trying to maintain the same properties as darcs.
21:54 DanielC Ok. I'm learning.
21:54 DanielC This is all very interesting.
21:55 DanielC I can see how this would make darcs less able to deal with some types of conflict. But I would also expect that the darcs merge would be more reliable in some sense or another.
21:55 Heffalump "more predictable" is how I'd put it
21:56 DanielC ok
22:15 Heffalump kowey seems to have just posted a nice example of git going wrong to the mailing list
22:23 arjanb how far are camp's conflictors from being sure that it will work?
22:24 Heffalump hopefully all the furious coq'ing will help
22:24 arjanb just wondering if it's useful for me to dig up conflictor free attempts before hac
22:41 Igloo I believe they'll work, but nothing's certain until we have a formal proof