[Fwd: git/cogito usage scenarios for CVS refugee]

Kevin Smith yarcs at qualitycode.com
Thu Jun 9 00:32:19 UTC 2005


Matt Mackall wrote:
> On Wed, Jun 08, 2005 at 06:50:21PM -0400, Kevin Smith wrote:
> 
>>Fair enough. I guess I was really spoiled rotten by my couple months 
>>using darcs. There are other things I don't like about darcs, but I now 
>>see that its patch management really is a quantum leap ahead of 
>>everything else. At least for small projects or if you have infinite 
>>computing power available.
> 
> 
> Perhaps I should take another look at the Darcs manifesto.

To give you a head start, here's my take on the practical effects of 
"patch theory":

I forget their terminology, but there are two ways of thinking about a 
patch: 1) the conceptual intended change, and 2) the actual 
representation, such as specific hunks.

The representation is context-specific. That is, encoded within the 
patch representation is the exact state of the tree to which it 
can/should be applied. The conceptual patch is context-independent, and 
is never actually written anywhere, because it can't be--it's 
conceptual, not real.

Darcs can "commute" (almost) any two consecutive patches that were 
applied to a given tree. That's a fancy way of saying they can be 
conceptually swapped. So if you had a tree where you had applied five 
conceptual patches ABCDE you could commute them to ABCED and then to 
ABECD. The patch representations would have changed as necessary such 
that applying these new representations in the new order would have 
exactly the same outcome as applying the old representations in the old 
order.

This allows you to cherry pick or skip any patch, while still being able 
to sync automatically. The patch you want to pull gets "commuted" in the 
source tree back to the point where your tree diverged from the target, 
and then it can be commuted in the destination tree forward from the 
divergent point up to the head.

Of course there are certain patches that can't commute because they 
truely conflict. But commuting most patches is actually pretty easy. 
About the only complex part is when you have multiple merges.

It's all very cool, and very powerful. And unfortunately it's also very 
memory-intensive and slow. I haven't followed darcs for several months 
now, but I haven't heard about any big speed improvements.

Kevin



More information about the Mercurial mailing list