Generates gource video of multiple source code repositories.

  • Download Gist
gource-multiple-repositories.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
#!/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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.