Created
May 25, 2016 18:59
-
-
Save djsegal/fed6fafb8bd7763a48060ad5ea08cecf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: | |
# $ multi-gource.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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment