
I have switched from Subversion to Git a few months ago as the version control system for all my private projects and some of my public projects and I’ve not looked back.
The setup can not be simpler (git init in the project directory) and gitweb is easy to setup to browse the repository and its history.
Git is simple to use, simple to learn (with good in-depth and user documentation) and fast.
When I am learning new languages or frameworks, I tend to use an exploratory mode made of trials and errors. I found that the workflow of Git (simple branch creations and merges, stashes, reset) corresponds better to this approach than Subversion (which works best with an upfront design).
One of its great features compared to Subversion is that it distinguishes between the author and the committer.
In Subversion, when an user submits a patch and I apply it, I’m both the committer and the author (I mention the user in the commit message and/or the header’s files but as far as Subversion is concerned, the user does not exist).
In Git, when I apply the patch, I’m only the committer, the user is the author of the commit and will remain so in the history, in git blame, etc. (as an example, here is a commit where I am the committer and Clay McClure is the author).
This feature is very important for open source projects where your reputation comes from the code you write, even if it is only through patches.
The only area where Git is lacking behind Subversion is the tools. However I don’t mind using a shell and Vim for most of the simple and frequent tasks. For advanced ones, gitk and
Textmate are good enough for my needs.
I continue to use Subversion for my professional work but for my personal projects, Git is now my main choice (the only exception being Eclipse projects but as soon as there is a Git plug-in which is good enough, I’ll switch too).
This post is for future references since I had to slightly adapt what is written in the INSTALL file to run Gitweb on my MacBook.
Assuming all my Git projects are in /Users/jmesnil/Work/ and I’ve already installed Git using MacPorts (sudo port install git-core), the steps to create gitweb.cgi is:
cd ~/Work
# retrieve the latest version of git
git clone git://git.kernel.org/pub/scm/git/git.git
cd git/
make GITWEB_PROJECTROOT="/Users/jmesnil/Work/" \
GITWEB_CSS="/gitweb/gitweb.css" \
GITWEB_LOGO="/gitweb/git-logo.png" \
GITWEB_FAVICON="/gitweb/git-favicon.png" \
bindir=/opt/local/bin
gitweb/gitweb.cgi
# CGI scripts are located in /Library/WebServer/CGI-Executables
mkdir -p /Library/WebServer/CGI-Executables/gitweb
sudo cp gitweb/gitweb.cgi /Library/WebServer/CGI-Executables/gitweb/
# And the other resources are in /Library/WebServer/Documents/
mkdir -p /Library/WebServer/Documents/gitweb
sudo cp gitweb/gitweb.css gitweb/git-logo.png gitweb/git-favicon.png \
/Library/WebServer/Documents/gitweb/
Once everything is copied to the right place, Gitweb is up and running:
http://localhost/cgi-bin/gitweb/gitweb.cgi?
I use Subversion for my daily work (and CVS before that) but I’ve never used a distributed VCS before.
One of my ex-colleagues, Marc, explained to me all the advantages of these systems but I never took the time to play with them.
With all the increasing noise about Git and Mercurial, I’m now curious to learn more about it.
Since I learn better by practicing, I moved one of my little projects, jmx4r, from Subversion to Git and hosted it on GitHub.
I don’t use jmx4r at the moment and I don’t plan to develop it more (less features is the new black). However, if you have requests for a new feature or enhancement (or bugs), do not hesitate to fill an issue on the tracker.
Or better, clone the Git project:
git clone git://github.com/jmesnil/jmx4r.git
and start hacking it!
P.S.:
With the recent release of JRuby 1.1, I also checked that the latest version of jmx4r had no regression.
Congratulation to the JRuby team for the performance boost since version 1.0!