Binary diff/merge proposal
jbowtie at amathaine.com
jbowtie at amathaine.com
Tue Oct 12 23:02:24 BST 2010
I plan on implementing this; before doing so I'd like some feedback on
the design - particularly given the work Gordon is doing with
lp:489915.
The focus is on binary formats but the handling of text formats would
be the same (ie, XML diffing and merging, for example).
Rationale
--------------
Content creators who work with primarily binary formats, such as
artists, video editors, and musicians, need more effective tools for
working with version control.
With free software formats, we have enough information to create
useful diff and merge behaviour.
Use Cases
----------------
Annika and Helmut are collaborating on a webcomic in GIMP. Annika
works on the background layers in one branch, while Helmut adjusts the
scripts and text bubbles in his branch. Annika pulls both branches
into trunk and pushes the final version to the web server.
Melissa works on a game using the Blender game engine. She creates an
experimental branch in which she adjusts the physics settings. Happy
with the results, she publishes her branch on Launchpad and proposes
merging the branch into trunk.
John is working on a spreadsheet on LIbre Office to calculate a
trading scenario. Mary tells him she has commited some adjustments to
a set of figures on sheet 5; John reviews the diff from her changeset.
Deciding that he needs to incorporate her changes, he pulls the
changeset which is seamlessly merged into his working copy.
Design - Diff
------------------
When a file is selected for diffing, it selects a differ from the
registry using the following algorithm:
1) If an specific diff tool was supplied on the command line, it is selected.
2) It matches the filename against the registered *pattern* - this
allows for a per-file diff.
3) It matches against the registered mimetype - this allows for
per-filetype diff.
4) It falls back to the default external diff program (if configured,
as per current functionality)
5) It falls back to the default diff algorithm.
The registry can be populated in 2 ways:
1) A plugin can register a diff tool for a particular pattern or mimetype.
2) External diff tools can be registered for a pattern or mimetype via
the configuration file.
Differs can supply both text-mode and gui-mode differs. A GIMP differ,
for example, can indicate which layers were changed in text-mode, and
actually display the changed layers in gui-mode.
Design - Merge
----------------------
Merge tools are selected in the same way as differs. For merge tools
we need to flag whether it supplies a gui for conflict resolution or
not.
More information about the bazaar
mailing list