Forked from cgoldberg/gource-multiple-repositories.sh
Created
November 7, 2023 14:56
-
-
Save timelf123/36d242bebb122ed140dd3f0ca46e3c74 to your computer and use it in GitHub Desktop.
Generates gource video of multiple source code repositories.
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: | |
# $ 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment