Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 59 additions & 18 deletions assets/demo.tape
Original file line number Diff line number Diff line change
@@ -1,39 +1,80 @@
# demo.tape — Generate demo.gif with: brew install vhs && vhs docs/demo.tape
# demo.tape — regenerate with `vhs assets/demo.tape` from the repository root.
#
# Needs vhs (https://github.com/charmbracelet/vhs) and commit-check on PATH.
#
# The hidden block below records inside a throwaway repository, so running this
# never leaves stray branches behind in the repository you invoke it from.

Output demo.gif
Output assets/demo.gif

Set Shell "zsh"

Set FontSize 16
Set Width 1000
Set Height 550
# The longest line a failure prints is the CC001 suggestion, at 131 columns.
# This width measures 132 columns (checked with `tput cols` in the recorder,
# not calculated — the glyph advance is 10.26px, not the 9.6px you get from
# assuming 0.6em). Narrower breaks that line, and the URL above it, mid-word.
Set Width 1400
Set Height 600
Set Theme "Dracula"
Set Padding 24
Set TypingSpeed 50ms
Set PlaybackSpeed 1.0

# --- Scene 1: Invalid commit message ---
Type "echo 'add user login' | commit-check -m"
Hide
# The identity matters: without it the initial commit fails, the repository is
# left with no commits at all, and every branch check then silently passes —
# which is exactly how this demo once recorded a failing branch as clean.
# ${DEMO_REPO:?} rather than a bare cd: when a command substitution produces
# nothing, zsh reads `cd $(...)` as plain `cd` and goes to $HOME — so a failing
# mktemp would have this git init a maintainer's home directory. The guard
# aborts the chain instead.
Type "DEMO_REPO=$(mktemp -d) && cd ${DEMO_REPO:?} && git init -q -b main . && git config user.name 'Dev' && git config user.email 'dev@example.com'"
Enter
Type "git commit -q --allow-empty -m 'feat: initial commit'"
Enter
Type "export PS1='%F{cyan}❯%f '"
Enter
Type "clear"
Enter
Sleep 2s
Show

# --- Scene 2: Valid commit message ---
Type "echo 'feat: add user login' | commit-check -m"
# --- A commit message that does not follow Conventional Commits ---
Type "echo 'add user login' | commit-check -m"
Enter
Sleep 2s
Sleep 4s

# --- Scene 4: Invalid branch name ---
Type "git checkout -b user-login"
# --- The same message, fixed. A passing check prints nothing and exits 0, so
# the demo reports the result rather than showing an empty line. ---
Type "echo 'feat: add user login' | commit-check -m && echo 'passed'"
Enter
Sleep 2s
Type "commit-check -b"
Sleep 3s

Hide
Type "clear"
Enter
Sleep 2s
Show

# --- Scene 5: Valid branch name ---
Type "git checkout -b feature/user-login"
# --- A branch name that does not follow Conventional Branch ---
Type "git switch -c user-login"
Enter
Sleep 2s
Sleep 1500ms
Type "commit-check -b"
Enter
Sleep 2s
Sleep 4s

# --- The same branch, fixed ---
Type "git switch -c feature/user-login"
Enter
Sleep 1500ms
Type "commit-check -b && echo 'passed'"
Enter
Sleep 3s

Hide
# Leave no throwaway repository behind. The same guard applies: an unset or
# empty DEMO_REPO aborts rather than handing rm -rf a bare path.
Type "cd / && rm -rf ${DEMO_REPO:?}"
Enter
Show