[RFC] Concept of unique line ids

Alexander Belchenko bialix at ukr.net
Tue Sep 4 17:13:05 BST 2007


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

Currently bzr have concept of unique file ids.
This concept play very well when files moved/renamed.

During many-many months I'm thinking about concept
of unique line ids. Current patience diff or classic
unidiff works with chunks of different/similar texts.

I think that concept of unique line ids is very important
for cherrypicking support, for detecting moving of lines
inside one file or between files.

Today I ran into very difficult situation with merge.
I'm working on python wrapper for TileTk library.
I have a branch where I heavily reformat sources
from one author to conform PEP-8. So, almost every
line in the sources was touched. Now I want to merge
small set of changes in original sources.

Diff for original sources is really small, but merge
in bzr produce HUGE conflict. Using merge --diff3
give me much better result (IMO, because patience diff
want to find max difference, while unidiff is not).

But actually I expect that merge will pick only new
changes and apply them to corresponding part of my sources.
But bzr unable to help me here.
With unique line ids IMO this should be straightforward:
apply changes only to lines with specific line ids.

May be I need thing that Aaron called annotation-based merge?
I don't understand merge internals deep enough, so
I'm not sure here. Annotation-based merge is not implemented yet,
right? Or I again missed something?

I'm played with ndiff (side-by-side diff) a bit to emulate
my idea, and I got good result, so I think this is right way.
I'm not sure how to prototype my idea inside bzr, because I need another
format to store deltas between revisions. Writing new VCS is too
complex and time-consuming for me.

Do I need to write specification draft for brainstorming?
Where to read about annotation-based merge to understand
is this the same or I on wrong way?

[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG3YQRzYr338mxwCURAswwAJ9rdpdFXcVEyzDmDLsTH7oh8ZP8WwCeP+s8
OxbiL26WygXD79jrqb/R56E=
=VNo2
-----END PGP SIGNATURE-----



More information about the bazaar mailing list