Visualising my commits to my work project
I recently stumbled upon gource, an amazing tool for visualising the history of commits made to a project (e.g. git, svn etc.). A video of commits to the Linux Kernel inspired me to have a go at making my own version for our main work project
To make the video, I needed to install gource
and ffmpeg
,which I did via brew:
$ brew install gource
$ brew install ffmpeg
Once installed, I changed directory to the folder where I had my old work project ( git
), and subsequently first ran this command to create the visualisation of our code:
$ gource \
-s 0.05 \ # the number of seconds per day
-a 1 \ # tell gource to skip days with no commits
./ \ # use the current directory where a .git repo is
--stop-at-end \ # stop the video at the end
--follow-user 'Calum Macdonald' \ # highlight me
--user-image-dir users-pictures \ # pick up a picture of me
An interactive window pops up which displays the animated changes to the code structure:
Once I was happy with the various settings that I could tune, I created a series of ppm
images by piping the output before running ffmpeg
to create an mp4
video file:
$ gource ... -o output.ppm
This can be all done in one step (via the —
flag) but I decided on an intermediate step as I wanted to tune a few things (e.g. video quality) and ffmpeg
can take a long time to run.
To use ffmpeg
and convert to an mp4
file I could upload to YouTube I ran:
$ ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i output.ppm -vcodec libx264 -preset medium -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 my-video.mp4
There are more instructions on these commands here.
Finally, my finished product on YouTube, a video of our software code history from 2017–2020: