Watch
0
0
Fork
You've already forked hyperhive
0

hyperhive-the-movie: date-only clock, milestone captions, less elasticity, AV1 webm, --help

The clock shows the date without the time of day. Elasticity drops from 0.3 to 0.1 so the tree sways less through large refactors. Captions come from the git tags and a tracked milestones file with a milestone per component and service at the commit that introduced it, plus growth markers (commit counts, 50k-line steps, issue and PR id doublings). --record writes gource-hyperhive.webm, AV1 in WebM through SVT-AV1, instead of a near-lossless H.264 file. --help (or -h) lists the flags; an unknown argument prints it on stderr and exits 2.
This commit is contained in:
damocles 2026-11-11 22:17:55 +01:00 • committed by mara
commit 1c3551b030

View file

@ -1,6 +1,9 @@
# `nix run .#hyperhive-the-movie` — gource visualisation of the git
# history of the repo it is run from. `-- --record` renders
# gource-hyperhive.mp4 in the cwd instead of opening a window.
# gource-hyperhive.webm in the cwd instead of opening a window: AV1 in WebM,
# which plays in current Firefox and Chrome and compresses this flat,
# dark picture far better than H.264. Milestones show as captions, from the git
# tags of the repo and from `hyperhive-the-movie-milestones.txt`.
{
lib,
writeShellApplication,
@ -27,8 +30,39 @@ writeShellApplication {
gnugrep
];
text = ''
usage() {
cat <<'USAGE'
hyperhive-the-movie - gource visualisation of this repo's git history
Usage: nix run .#hyperhive-the-movie -- [--record | --help]
(no flag) open a gource window and play the history
--record render gource-hyperhive.webm in the current directory
instead (1280x720, 30 fps, AV1 in WebM; plays in recent
Firefox and Chrome). Needs no display.
-h, --help show this text
Run it from inside the repo. Captions come from two places: the git tags
(shown at the tagged commit's date) and the milestones file,
nix/packages/hyperhive-the-movie-milestones.txt, one "YYYY-MM-DD|caption"
per line. Edit that file, or tag a commit with `git tag NAME COMMIT`.
USAGE
}
record=false
[[ "''${1:-}" == "--record" ]] && record=true
case "''${1:-}" in
"") ;;
--record) record=true ;;
-h | --help)
usage
exit 0
;;
*)
echo "hyperhive-the-movie: unknown argument '$1'" >&2
usage >&2
exit 2
;;
esac
cd "$(git rev-parse --show-toplevel)"
@ -50,13 +84,28 @@ writeShellApplication {
fi
done < <(git log --format='%an' | sort -u)
# Milestone captions, `unix time|text`, sorted by time: the tracked
# milestones file (`YYYY-MM-DD|text`) and the repo's git tags.
captions="$(mktemp)"
trap 'rm -f "$captions"' EXIT
{
while IFS='|' read -r day text; do
[[ -z "$day" || "$day" == \#* ]] && continue
echo "$(date -d "$day" +%s)|$text"
done < ${./hyperhive-the-movie-milestones.txt}
git for-each-ref --format='%(creatordate:unix)|%(refname:short)' refs/tags
} | sort -n > "$captions"
# Catppuccin Mocha, as in frontend/packages/shared/src/colors.css.
args=(
-s 1 -1280x720 --auto-skip-seconds 1 --multi-sampling --stop-at-end
--date-format "%Y-%m-%d"
--caption-file "$captions" --caption-size 28 --caption-duration 4
--caption-colour f9e2af
--background-colour 1e1e2e --font-colour cdd6f4
--highlight-colour f9e2af --highlight-users --highlight-dirs
--filename-colour 585b70 --dir-colour 89b4fa
--bloom-multiplier 1.5 --bloom-intensity 0.75 --elasticity 0.3
--bloom-multiplier 1.5 --bloom-intensity 0.75 --elasticity 0.1
--title hyperhive
--logo ${logo} --logo-offset 20x20
--user-image-dir "$avatar_dir"
@ -68,8 +117,8 @@ writeShellApplication {
gource "''${args[@]}" --output-ppm-stream - --output-framerate 30 \
| ffmpeg -y -r 30 -f image2pipe -vcodec ppm -i - \
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" \
-vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 \
gource-hyperhive.mp4
-c:v libsvtav1 -preset 6 -crf 34 -g 300 -pix_fmt yuv420p \
gource-hyperhive.webm
else
gource "''${args[@]}"
fi