Visualizing Subversion’s Commit History

Yeah, it’s Friday! Woohoo. Yup, that’s right people, it’s time to kick off your shoes and code…

I have not posted in like two weeks. Lemme tell ya, One of those weeks I spent in Vegas on a much needed vacation without a laptop. It was pretty spectacular. This week has just flown by. But today I felt like doing something fun; I felt like being a movie producer, director, composer, etc. However, I don’t really like to get off the couch just to film a movie when I have a at least 25 storylines wandering around my computer.

Without further pause here is my story of the main Subversion repository I contribute to at work:
[ By the way, dots (or nodes) are directories or files. As the two people-icons run around the screen they are making subversion commits. Explosions typically occur when a big check-in happens. ]

Enjoy? Let’s make you a video. Visualizing Subversion commit activity is crazy simple. Dayum! I’m running Mac OS X 10.6.8 so all of following was done on that environment.

You’ll want to get ffmpeg and some codecs. I use Darwin Ports to manage packages like these so if you’re like me here’s the quick fix

sudo port install ffmpeg +gpl +lame +x264 +xvid

Next, we’re going to need Gource, and ffmpeg.

Download gource. unzip it and head into the directory. once in the gource directory go ahead and

sudo ./configure
sudo make; sudo make install
gource --help

Alright we’re pretty much ready to go. Head over to one of your subversion root directories. Add this file to your directory: summerfun.conf
and in it put

[gource]
bloom-intensity=0.25
colour-images=true
hide=filenames,dirnames
path=my-project-log.xml
seconds-per-day=0.1

You’ll see the my-project-log.xml is nowhere to be found. Let’s create it:

svn log -r 1:HEAD --xml --verbose --quiet > my-project-log.xml

That will make the video play a little faster. You can remove or muck with all of the settings; just read the README for available options. Now here is the command I executed:

gource --load-config summerfun.conf -1280x720 -o - | ffmpeg -y -b 10000K -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -vpre default -threads 0 -bf 0 gource.x264.mp4

This command launches a video; watch it & interact with it. Give it a try. All interactions get recorded in the video output. So zoom as you wish, to entertain your watchers. Let me know how it goes and post your videos.

Reference: