Skip to content

Instantly share code, notes, and snippets.

@jrwren
Last active March 1, 2018 21:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrwren/e049a8320e0d4ee320a3bbce33810216 to your computer and use it in GitHub Desktop.
Save jrwren/e049a8320e0d4ee320a3bbce33810216 to your computer and use it in GitHub Desktop.
gource format a git log for only a given subtree of a git repo.
## gawk or mawk are required for awk. The BSD awk with macOS is NOT sufficient.
# brew install gawk gource ffmpeg
git log --reverse --name-status --format="%at|%an|" . | awk '/^1/ {h=$0} /^[AMD]/{print h$1"|"$2}' |\
gource --log-format custom -
# or with some nice options
git log --reverse --name-status --format="%at|%an|" . | awk '/^1/ {h=$0} /^[AMD]/{print h$1"|"$2}' |\
gource -s .1 -1280x720 --auto-skip-seconds .1 --multi-sampling --stop-at-end -key --highlight-users \
--hide mouse,progress --file-idle-time 0 --max-files 0 --background-colour 000000 \
--font-size 22 --title "The history of streetwatchd" --log-format custom -
# or mp4 output
git log --reverse --name-status --format="%at|%an|" . | awk '/^1/ {h=$0} /^[AMD]/{print h$1"|"$2}' |\
gource -s .1 -1280x720 --auto-skip-seconds .1 --multi-sampling --stop-at-end -key --highlight-users \
--hide mouse,progress --file-idle-time 0 --max-files 0 --background-colour 000000 \
--font-size 22 --title "The history of streetwatchd" --output-ppm-stream - \
--output-framerate 60 --log-format custom - |\
ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - \
-c:v libx264 -preset slow -crf 22 -pix_fmt yuv420p -profile:v high422 output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment