Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[cdv-devel] Supporting convergence: msg#00037

version-control.codeville.devel

Subject: [cdv-devel] Supporting convergence

I've been haggling over the following case, and concluded that it produces
a real problem:

a
/ \
| b
| |
b a

The problem is that there are two possible things which the user who
changed back to a could mean - either 'pretend that change was never
applied to this branch' or 'that change was a bad idea and should be
forgotten globally'. There is no single right answer, so what you really
want is a conflict.

Since in this case the problem is a collision between the implications of
implicit undo and convergence, I decided to work out how to support
convergence with no implicit undo at all.

It turns out that the answer is quite simple. A scalar is treated as a
bunch of separate binary variables, for each value which has appeared, and
versioned independently (and if an amount other than 1 of them is set to
on you have a conflict). Each of those variable is versioned by giving it
a single numerical value. All variables start with 0. When the variable is
set to on the value changes to 1. When it's set off again the value
changes to 2. From there on each time the variable is changed the value is
incremented by one. When two values are merged together, the greater one
wins.

This technique is very much like how line versioning was done originally,
only back then once a value got to 2 it stayed there permanently, never
increasing to 3. It seems like way to simple a trick to magically do
implicit cherry-pick interpretation, but on paper it seems to work, and
I'll have to test it (a modest alteration to the reference code I posted
before, just rewriting LivingStatus, will do it).

There are limitations to this approach. For one thing, if you cherry-pick
the changes from value 0 to value 5, that will be implicitly interpreted
as a change to value 1. Likewise if you cherry-pick from 0 to 4 that will
not even show up on the radar. And cherry-picking from 4 to 5 onto value 0
will result in 1, when it isn't even very clear what that should do.

Also, this approach doesn't support any implicit undo (duh, that's the
point of this exercise). I'll have to think more about the interactions
with implicit undo and how they should be handled. I don't think it's
terribly controversial to say that the following should merge clean:

a
/ \
| b
| |
c a

Or maybe it is. I dunno. Perhaps we'll wind up with a system which asks
users if particular hunks are undos or forward rewrites.

These are fairly substantive limitations. They appear intractable to
completely fix using only implicit information. In particular, a
cherry-pick from version 0 to 4 will produce no change in the code
whatsoever, and only affect later merging, so implicit inference clearly
can't support it.

That said, I'm a bit tacken aback at how simple this is. It couldn't be
*that* easy to support magic implicit cherry-picking, after all the time
we've spent haggling with it. The limitations I gave above are unlikely to
show up all that often in practice, and the benefits for a system which
does this are clearly useful, especially for a system like git which has
offline cherry-picks done constantly.

-Bram


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation