Ayende @ Rahien

It's a girl

Distributed Source Control

I had a short discussion with Steve Bohlen about distributed source control, and how it differs from centralized source control. After using Git for a while, I can tell you that there are several things that I am not really willing to give up.

  • Fast commits
  • Local history
  • Easy merging

To be sure, a centralized SCM will have commits, history and merging. But something like Git takes it to a whole new level. Looking at how it changed my workflow is startling. There is no delay to committing, so I can commit every minute or so. I could do it with SVN, but it would take 30 seconds to a minute to execute, blocking my work, so I use bigger commits with SVN.

Having local history means that I can deal with a lot of small commits, because diffing a file from two commits ago is as fast as diffing the local copy. I tend to browse around in the history quite a lot, especially when I am doing stuff like code reviews, or trying to look at how I did something three weeks ago.

Merging is another thing that DVCS excels at. Not so much because of better merge algorithms (although that is a part of this), but simply because having all the information locally make the merge process so much faster.

All in all, it end up being a much easier process to work with. It takes time to get used to it, though.

And given those requirements, Fast commits, Local history, Easy merging, you pretty much end up with a distributed solution. Even with a DVCS, you still have the master repository, but just the fact that you have full local history frees you from having to manage all of that.

Comments

Barry Dahlberg
09/28/2009 12:27 AM by
Barry Dahlberg

Other than fast commits, wouldn't something like SVN with the addition of sensible client side caching have much the same effect?

For me one of the biggest wins is getting rid of all those .svn folders scattered through my project causing no end of trouble when renaming or copying folders.

Ayende Rahien
09/28/2009 12:33 AM by
Ayende Rahien

Barry,

.svn folders are annoying, yes.

And I like the way Git tracks renames much better, yes.

But what is client side caching? All the repository? If so, you are in DVCS.

If not, you are going to hit the cache limits and fall back to the same bad experience.

I did a lot of SVN Caching when I worked on SvnBridge, it is a tough problem.

And it doesn't help for fast commits

Dmitriy Nagirnyak
09/28/2009 11:09 AM by
Dmitriy Nagirnyak

What about tooling? SVN has great tool-set main of them are AnhSVN and TurtoiseSVN.

I do not see mature tooling for Git on Windows.

Also I still think SVN is best suited for a small team (or even for single developer). Can you agree on this?

Ayende Rahien
09/28/2009 11:16 AM by
Ayende Rahien

Dmitriy,

There are good tooling for Git. TortoiseGit gives you a very similar experience, for example.

And no, there is still the high cost of communication to the server, even for a lone developer.

Tobin Harris
09/28/2009 11:43 AM by
Tobin Harris

I actually much prefer Git for use as a single developer. Creating a local repository on a local or network drive is incredibly simple, and if I want to distribute that repository to a remote server or another person it's also very easy. I even use Git for 1-hour throw away projects just for useful rollback and logging :)

I don't recall SVN being so simple, mainly because you need more tools - one set of tools for repo admin and another for repo usage.

Dmitriy Nagirnyak
09/28/2009 11:55 AM by
Dmitriy Nagirnyak

Yes, I saw the TortoiseGIT. I also heard it has lots of issues, not sure about that though.

But still there is not anything like AnkhSVN/VisualSVN. I find them very useful working in Visual Studio. It saves a lot of time by keeping track of actions I do with files.

Additionally it seems a bit problematic to host GIT on Windows.

I just don't really get the right feeling about GIT and not sure how I can gain one...

Josh Schwartzberg
09/28/2009 11:57 AM by
Josh Schwartzberg

You should check out Accurev when you do need a centralized system, it's really fast and lets you commit to your own "workspace".

Ryan Cromwell
09/28/2009 02:25 PM by
Ryan Cromwell

Is that the sound of the "everything on the intertubes" pendulum creaking back in the other direction?

Ayende Rahien
09/28/2009 05:13 PM by
Ayende Rahien

Ryan,

Oh, I still want everything up there, I am moving between machines so much that I need to maintain stuff out there, otherwise I am facing big sync issues

josh
09/28/2009 05:29 PM by
josh

what's also cool about git.. If you have 2 remotes with differing source, you can checkout the clone of that remote as if it was the local copy.

Try it.. Go fork a project on github. clone your fork, and add the original as a remote ">git remote add ..." Then make a change to your local, and run "git checkout [remote-name]". You'll see the code without your change, and you can switch back to your local master to have your change back.

pretty cool if you ask me.

Stephen
09/28/2009 07:00 PM by
Stephen

Oh wow, svn folder hell- can't count how many times I've had to piss around making svn happy.. other than that I've not had THAT many issues with it.

Barry Dahlberg
09/28/2009 09:33 PM by
Barry Dahlberg

"But what is client side caching? All the repository? If so, you are in DVCS."

I guess that helps clarify exactly what a DVCS is for me then! I know git is so much more than that but I'm mostly a one man team so the collabortaion features are between me myself and I.

Kornelije Sajler
09/29/2009 01:21 AM by
Kornelije Sajler

Instead of TortoiseGit I found Git Extensions a lot more useful and it integrates nice with Visual Studio. Git Extensions are not as pretty as ViualSVN but very simple and powerful, jut like Git.

John "Z-Bo" Zabroski
10/02/2009 11:24 PM by
John "Z-Bo" Zabroski

The collaboration features are indeed between yourself and yourself.

And that's a huge feature.

Yourself today is not yourself yesterday.

Yourself when your hard drive is crashing is not yourself when you are writing code. And guess what all you need to do to verify your repository is to make sure it matches the hash you recorded at a particular release.

Daniel
10/27/2009 02:26 PM by
Daniel

I respect Git a lot since it's a DVCS but I don't know if I've missed something here. Why Git over Bzr?

Bzr seems to be a lot more friendly on windows. I've seen no VS integration yet but TortoiseBzr does most of the things and it also has a more stable renaming capability than Git.

Yes, Git is faster than Bzr but IMHO userfriendlyness is more important.

Comments have been closed on this topic.