Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generates gource video of multiple source code repositories.
#!/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:
# $ /path/to/repo1 /path/to/repo2
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}
let i=$i+1
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.