Forked from derEremit/gource-multiple-repositories.sh
Last active
December 19, 2015 12:19
-
-
Save azone/5954218 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 (h.264) out of multiple repositories. | |
# Pass the repositories in command line arguments. | |
# Example: | |
# <this.sh> /path/to/repo1 /path/to/repo2 | |
RESOLUTION="1920x1080" | |
outfile="gource.mp4" | |
i=0 | |
for repo in $*; do | |
# 1. Generate a Gource custom log files for each repo. This can be facilitated by the --output-custom-log FILE option of Gource as of 0.29: | |
logfile="$(mktemp /tmp/gource.XXXXXX)" | |
gource --output-custom-log "${logfile}" ${repo} | |
# 2. If you want each repo to appear on a separate branch instead of merged onto each other (which might also look interesting), you can use a 'sed' regular expression to add 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 \ | |
-i 0 \ | |
-$RESOLUTION \ | |
--highlight-users \ | |
--highlight-dirs \ | |
--file-extensions \ | |
--hide mouse,filenames \ | |
--key \ | |
--stop-at-end \ | |
--output-ppm-stream - | avconv -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K "$outfile" | |
rm $combined_log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment