November 17, 2013

Gource Visualization of Ubuntu Touch Core Apps Development

TLDR: I made a cool version control visualization of all the Ubuntu Touch Core Apps.

The video: https://www.youtube.com/watch?v=nAmKAgRS0tw

* Warning: abrasive techno music
* To be watched in HD, preferably at maximum volume


Making Gource visualizations of complex software projects is awesome. I love seeing a VCS commit log come to life as blooming trees and swarming workers. Normally, I do a visualization video of a single repository. But in this case, I used a bash script to create a visualization of multiple source code repositories. I wanted to see the progress of the entire stack of Ubuntu Touch Core Apps (17 projects). Ubuntu Touch Core Apps is an umbrella project for all [17] of the core apps that are available in Ubuntu on mobile devices

The Ubuntu Touch Core Apps:

  • Dropping Letters
  • Evernote Online Accounts plugin
  • QtDeclarative bindings for the Grilo media scanner
  • Stock Ticker App
  • Sudoku App
  • Ubuntu Calculator App
  • Ubuntu Calendar App
  • Ubuntu Clock App
  • Ubuntu Document Viewer App
  • Ubuntu E-mail App
  • Ubuntu Facebook App
  • Ubuntu File Manager App
  • Ubuntu Music App
  • Ubuntu Phone Commons
  • Ubuntu RSS Feed Reader App
  • Ubuntu Terminal App
  • Ubuntu Weather App

Making the visualization:

Assuming you have a bunch of source code repositories already branched/cloned locally, here is a general version of the script to generate visualization videos of multiple projects/repositories: https://gist.github.com/cgoldberg/7488521

#!/usr/bin/env bash
# Generates gource video out of multiple repositories.
# First, get a local branch/clone of each repository.
# Then, pass the repositories as command line arguments.
#
# Example:
# $ gource-multiple-repositories.sh /path/to/repo1 /path/to/repo2
outfile="gource.mp4"
resolution="1920x1080"
i=0
for repo in $*; do
# generate a gource custom log file for each repo
logfile="$(mktemp /tmp/gource.XXXXXX)"
gource --output-custom-log "${logfile}" ${repo}
# make each repo appear on a separate branch by adding
# an extra parent directory to the path of the files in each project.
sed -i -E "s#(.+)\|#\1|/${repo}#" ${logfile}
logs[$i]=$logfile
let i=$i+1
done
combined_log="$(mktemp /tmp/gource.XXXXXX)"
cat ${logs[@]} | sort -n > $combined_log
rm ${logs[@]}
echo "Committers:"
cat $combined_log | awk -F\| {'print $2'} | sort | uniq
echo "======================"
time gource $combined_log \
-s 0.4 \
-$resolution \
--auto-skip-seconds 1 \
--multi-sampling \
--highlight-users \
--highlight-dirs \
--file-extensions \
--file-idle-time 0 \
--max-files 0 \
--hide mouse,progress \
--key \
--stop-at-end \
--output-ppm-stream - \
--output-framerate 30 \
| avconv -y -r 30 -f image2pipe -vcodec ppm -i - -b 8192K $outfile
rm $combined_log

The script I used to create the Ubuntu Touch Core Apps video: https://gist.github.com/cgoldberg/7516510

#!/usr/bin/env bash
# Generate gource video out of bzr repositories for Ubuntu Touch Core Apps.
#
# Corey Goldberg 2013
#
# Usage:
# gource-ubuntu-core-apps.sh /path/to/repo1 /path/to/repo2
#
# Example - generate video for all Ubuntu Touch Core Apps:
# $ ./gource-ubuntu-core-apps.sh \
# account-plugin-evernote \
# dropping-letters \
# music-app \
# reminders-app \
# stock-ticker-mobile-app \
# sudoku-app ubuntu-calculator-app \
# ubuntu-calendar-app \
# ubuntu-clock-app \
# ubuntu-docviewer-app \
# ubuntu-emailclient-app \
# ubuntu-facebook-app \
# ubuntu-filemanager-app \
# ubuntu-phone-commons \
# ubuntu-rssreader-app \
# ubuntu-terminal-app \
# ubuntu-weather-app
outfile="gource.mp4"
resolution="1920x1080"
# get a bzr branch of each project
for repo in $*; do
branch_command="bzr branch lp:"$repo
echo $branch_command
$branch_command
done
i=0
for repo in $*; do
# generate a gource custom log file for each repo
logfile="$(mktemp /tmp/gource.XXXXXX)"
gource --output-custom-log "${logfile}" $repo
# make each repo appear on a separate branch by adding
# an extra parent directory to the path of the files in each project.
sed -i -E "s#(.+)\|#\1|/${repo}#" ${logfile}
logs[$i]=$logfile
let i=$i+1
done
# generate the combined log
combined_log="$(mktemp /tmp/gource.XXXXXX)"
cat ${logs[@]} | sort -n > $combined_log
rm ${logs[@]}
# remove the branch directories after creating log
for repo in $*; do
rm -rf $repo
done
# print the committers found
echo "Committers:"
cat $combined_log | awk -F\| {'print $2'} | sort | uniq
echo "======================"
# run gource, piping output to avconv for video rendering
time gource $combined_log \
-s 0.2 \
-$resolution \
--logo ubuntu_logo.png \
--title "Ubuntu Touch Core Apps" \
--auto-skip-seconds 1 \
--multi-sampling \
--highlight-users \
--file-extensions \
--highlight-dirs \
--file-idle-time 0 \
--max-files 0 \
--hide mouse,progress \
--key \
--stop-at-end \
--output-ppm-stream - \
--output-framerate 30 \
--background-colour 000000 \
--default-user-image user_icon.png \
--colour-images \
--font-size 28 \
| avconv -y -r 30 -f image2pipe -vcodec ppm -i - -b 8192K $outfile
# remove the log when done
rm $combined_log

No comments: