Previewing changes

John Arbash Meinel john at arbash-meinel.com
Wed Jul 30 14:58:54 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ben Finney wrote:
| Aaron Bentley <aaron at aaronbentley.com> writes:
|
|> Ben Finney wrote:
|>> I'm very attached to 'diff --using foodiffprog'. Does 'merge
|>> --preview' allow specifying options to the 'diff' that is
|>> performed?
|> Not at present. It was a hard choice, but I thought it was more
|> important to provide all the options of merge than all the options
|> of diff, so I put this functionality in the merge command rather
|> than the diff command.
|
| I'm glad that re-implementing 'diff' was rejected, but it's not what I
| was asking for. Instead, I was asking: since 'merge' can now perform a
| 'diff', can we provide options to the 'diff' thus performed?
|
| That question assumes (correctly?) that 'merge' is using the bzr
| 'diff' command to do the 'diff' work, rather than re-implementing it.
|
| I assume further that the answer to this question is also "no, there
| is no way to tell 'merge' the options it should give to the bzr 'diff'
| command".
|

So... there are a few things about merge --preview which should probably
be explained.

1) When you do 'bzr merge', we stage all the changes into
.bzr/checkout/limbo/*

This allows us to find out about conflicts and run into any problems
*before* we change any of your precious files.

2) The files and directories in limbo do not *look* like the ones in the
tree. The generally have names like "new-1234". This happens because we
have to avoid collisions in the staging area, and we aren't going to
recreate the entire working tree each time.

3) 'merge --preview' generally works by staging the merge, and then
presenting the combination of the basis-tree + staged changes as another
tree "snapshot" which can then be compared to other trees (such as the
original basis tree, which is what 'merge --preview' explicitly does.)

4) This is rather difficult to present to a 3rd party too. The basis
tree doesn't exist on disk (it was the last commit to the working tree,
which may be partial, or may have more uncommitted changes), and the
temporary changed files do not have names which match the original path.
Basically, if I was writing the quick-and-dirty solution, I would have
to export the basis tree to a temp directory, and then export the
preview tree to another temp directory, and then run your
diff/meld/kdiff3 process on it (and for most tools, you would also want
the "BASE" tree, which is the common ancestor between them.)
It is possible, but it *really* wouldn't scale into large projects.

5) I don't know whether Tortoise/Olive/Qbzr yet play with the 'merge
- --preview' functionality. Aaron has done a great job on the internals,
and I would expect them to eventually grow support for it. (He's even
been working on making PreviewTree layerable, so you can see what your
merge would look like assuming this other merge would have occurred.)

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkiQc54ACgkQJdeBCYSNAAM0yACglztA9UMFb7C3FMj2vX86gr9v
CjwAnjZllwLUAlfs+yXTX+dQI+8uzVyK
=3DDW
-----END PGP SIGNATURE-----



More information about the bazaar mailing list