The Spectre of Math

August 31, 2010

directed acyclic graphs suck for a vcs

Filed under: Hacking,Technology — jlebl @ 7:28 pm

DVCS systems like git work on a directed acyclic graph (DAG) model where branching happens automatically with just about any commit. Traditional vcs (e.g. CVS) works generally as a tree where branching must be explicitly done.

Now the argument for DVCS is that you can commit without merging differences done by someone else. The axiom seems to be

Axiom of DVCS: Merging should be done as late as possible.

What’s wrong with that? Well nothing if you are happy for the computer to just blindly merge two very divergent code bases without worrying about interactions of those changes (you kept hacking on feature A which required that function foo works in a certain way, while person working on feature B changed how foo works because he didn’t see anybody use it yet because your use of it was in a branch that the second person of course didn’t look at because he was busy working on feature B). No that never ever happens because all developers always talk to each other about every little change and because every internal function/method/object is completely documented. Yeah.

With traditional VCS, merging is required when checking in. The axiom changes to:

Axiom of traditional VCS: merging should happen as early as possible when divergence is as small as possible.

When everyone continually has to keep up with all the other changes that other people are working on, possibility of screwing up is smaller. Merging other people’s changes into your tree can be far simpler if it was just someone’s morning worth of work with say 100 lines of code. You can actually look at that quickly to review what happened. Not to mention you will have to look at it if there are direct conflicts with your work. Furthermore, if the other person changed how function foo works, you will notice sooner rather than later so you can resolve the conflict before both of you go too far assuming function foo works in a certain way.

I know exactly why DVCS is more popular nowadays. Firstly it is new and new things are always better even if they are worse. Second, it is more complicated, and complicated things must always be better. But most importantly of all: DVCS has a lot more buzzwords. It is distributed, it uses directed acyclic graphs (finally you have a use for some of your CS classes). Lots of things that work are replaced continuously by complicated things that don’t.

Example: I would say the level of the desktop software (Windows, Linux, and Mac) has not improved substantially. It has changed yes. It does lots of graphical voodoo. It allows you to do things that nobody ever wants to do. But if you took a basic desktop from the year 2000 and you simply fixed it to work right, you’d have a much faster, much more productive environment. But fixing things is not as much fun as rewriting a desktop on OpenGL, making windows wiggle, and making a different funky widget set for each application.



  1. if you’ve ever worked with a large team of developers you’d know that the model you like doesn’t work.

    Consider the size of the team supporting Linux or Android. There are thousands. How would the axiom of VCS work? Who chooses which people sit idle while others get to check out and alter code?

    Comment by Anton — October 6, 2010 @ 1:04 pm | Reply

    • I worked on GNOME, that was quite a large project. The thing is, that if you make your project so monolithic that you have thousands of developers stepping on one another, then you might have other problems. Plus the “axiom of VCS” as I’ve stated is better for a larger project. I seem to have not explained that properly for you, or you seem to have not read that paragraph. In a DVCS environment you get more people diverging with their codebase more. In a project where there are fewer branches and code from one developer is immediately available to others, everybody can work all the time. Nobody needs to sit idle or keep untangling their branches.

      Sure you can branch for major work that you don’t want others to run until ready. Nothing stopping you from doing that.

      I have no clue where you got that “sitting idle” idea, since my whole point was that in VCS people get more work done with fewer distractions.

      Comment by jlebl — October 6, 2010 @ 2:02 pm | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: