Monday, May 2, 2011

Observations on Git

I've been playing around with Git lately as a couple of my developers are pushing for its adoption in our projects. I'm not quite sold on it, but I certainly see the advantages. Here are my thoughts on what I hear about it:

Branching in Git is Easier. Ok. Truth be told, I wasn't aware that branching in other version control systems was particularly difficult.

Merging in Git is Easier. BULLSHIT! Bullshit! Bullshit! Bullshit! What makes merging codebases hard has nothing to do with a version control system. The difficulty of a code merge is directly related to the extensibility and modularity of the code. What is being said here by Git advocates is that merging a branch to another local, baseline branch is easy. Big deal! Merging a branch with changes to one with no changes should be easy.

The thing Git advocates are really trying to say is that experimentation with codebases is easier, an argument I find agreeable. Git makes creating local branches and switching to them a snap. But its not like experimentation can't be done with Subversion using svn copy and svn switch commands. The benefit of Git in this scenario is that doing such things takes less thinking and time. And less time muddling with your VCS means more time muddling with your code.

With Git you do not have to be online. This hardly seems like a good argument, as what is really being said here is that you can run back and forth through the history of a project without access to a central repository, so long as that history doesn't go forward past the last time you pulled down changes. This is only mildly useful in my opinion, as I can tell you that many developers seldom consult code history. Certainly code history is useful, but I don't think it is something used on a regular basis.

You can share code between developers easier with Git. Absolutely. And in my opinion, this is the biggest selling point. But features such as this have been available for years in IDEs, and such a thing isn't terribly hard with the svn copy and svn switch commands in Subversion. But with Git doing this is more natural and IDE independent.

Git bisect is the bomb. Ok, this is really just my opinion. But I fail to understand why Git advocates don't tout this feature. The git bisect command is great for finding where in a branch code went sideways.

You can share code easier with Git. No, I'm not repeating myself. But I wanted to separate out what I feel is a major shortcoming of Git, which summarized could be said "You can infect code easier with Git." With Git, the authentication model has nothing to do with the commits. I can authenticate all day long as Bob but if I set my name to "Alice" in the Git configuration, the commits look like they are coming from Alice. This breaks a major usage pattern of VCS, where everybody can get to everything but if you screw something up, we know where you live. I suppose with a version control system that allows one to re-write history, this is just icing on the cake.

Now don't get me wrong. I'm not stating that "NO WAY IN HELL AM I USING GIT BECAUSE OF THESE VULNERABILITIES!" I can accept that I might be completely overreacting to code attacks done in this matter. But keep in mind, it is not just the malicious to be concerned about but also the incompetent. And any VCS that so easily allows one to do the wrong thing (or two) in a bad way should be of concern.

Overall, I think Git is cool. But I'm not quite sure it is for everyone.... or rather, every project.

0 comments:

Post a Comment