[RFC] Patience diff & merge?

Martin Pool mbp at sourcefrog.net
Mon Apr 10 02:35:46 BST 2006


On 09/04/2006, at 11:40 AM, Aaron Bentley wrote:
>
> There are many ways of finding common subsequences in a pair of texts.
> The Patience algorithm (http://en.wikipedia.org/wiki/ 
> Patience_sorting),
> implemented by Bram Cohen and tweaked by John Meinel seems to be a
> better job of this than the standard Python functionality.
>
> I have an updated branch of John Meinel's work here:
> http://code.aaronbentley.com/bzr/bzrrepo/others/bzr.patience/
>
> I would like to merge this into bzr, but some things may be
> controversial.  Using Patience sorting for everything would cause  
> bzr to
> produce structurally different weaves for a given input.  They would
> arguably be more useful weaves for annotation purposes, but  
> nevertheless
> ~ different.  I haven't come up with a case where that would be a
> problem, and perhaps no such cases exist.
>
> So our options seem to be
> 1. Switch all our UI functionality, including three-way merge, to  
> using
> Patience.
> 2. Provide patience as an option for diff and merge
> 3. Switch all of bzr, including weave generation to using patience
> 4. Not do anything

I would like to do #3, though I'm not sure if it's a totally safe  
change to do before 0.8 release.  Perhaps we can get more confidence  
by doing some stress tests on many inputs to make sure that the diffs  
are at least correct, if not optimal.

One of the previous diffs used difflib to try to reduce the  
mismatched areas produced by patience diff.  Do you still do it?  Are  
you sure it's a good idea?

-- 
Martin







More information about the bazaar mailing list