Handling unmergeable files -- a call to arms
Stephen J. Turnbull
stephen at xemacs.org
Wed Jun 3 03:59:21 BST 2009
Russel Winder writes:
> Stephen,
>
> On Mon, 2009-06-01 at 12:09 +0900, Stephen J. Turnbull wrote:
> > Russel Winder writes:
> >
> > > Two thoughts:
> > >
> > > Every branch/clone in DVCS is a separate fork of a project, it is not a
> > > member of a distributed cache.
> >
> > This is false for git, at least. That is the whole point of git's
> > object database.
>
> I guess we have to get into nitty gritty details to argue this one --
> whilst fun, I am not sure it is crucially important. The critical
> question is whether two repositories can diverge independently (which
> clearly then can since this is DVCS) and then be forced into consistency
> by outside agents -- I am not sure that this is the case for any DVCS.
> However my knowledge of Git is not sufficiently detailed to be
> confident.
Indeed, that is the critical question. In the case of git,
consistency is *always* forceable in the sense that both repositories
contain the same content and history, up to renaming of branches,
*without* losing any content, history, or branch heads. *Objects
(content, trees, commits, tag objects) have the same name in both
repositories.* (That's what I mean by "git is a distributed cache",
YMMV. If that's uncomfortable for you, I'm happy to change my
terminology.) I don't know how much of that is true for Bazaar or
Mercurial; it's basically false for Darcs, and meaningless for CVS and
Subversion.
So what we need to do here is define "consistency". In the current
context, clearly it's not "consistent" to have two heads purporting to
be "current", but which contain differing revisions of "unmergeable"
files. Git is not consistent in that sense, but it does allow
convenient (colocated) management of these "Doppleganger" revisions.
Note that in a merge no current VCS actually merges storage (it's
arguable that formats like knits and weaves do that in a relevant
sense, but I'm going to put that aside for now). Rather, to merge in
the working tree a new file is written and the old ones discarded.
The main issue here then is how to choose from two (or more)
unmergeable versions, or if there is some way to assist in merging
them.
More information about the bazaar
mailing list