Skip to content

Commit dbb8978

Browse files
committed
chore: re-add sanitized demo GIF
1 parent e71d3fd commit dbb8978

3 files changed

Lines changed: 34 additions & 0 deletions

File tree

demos/demo.gif

138 KB
Loading

filter-repo-replacements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
literal:/Users/graphtheory==>/Users/graphtheory
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
# Remove demo media (and optional path replacements) from entire git history.
3+
set -euo pipefail
4+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5+
cd "$ROOT"
6+
7+
if ! command -v git-filter-repo >/dev/null 2>&1; then
8+
echo "Install: python3 -m pip install git-filter-repo" >&2
9+
exit 1
10+
fi
11+
12+
ORIGIN=""
13+
git remote get-url origin >/dev/null 2>&1 && ORIGIN="$(git remote get-url origin)"
14+
15+
INVERT=()
16+
[[ -e demos/demo.gif ]] && INVERT+=(--path demos/demo.gif)
17+
[[ -d demos/vhs/out ]] && INVERT+=(--path demos/vhs/out)
18+
[[ -d assets/demos ]] && INVERT+=(--path assets/demos)
19+
20+
if ((${#INVERT[@]} > 0)); then
21+
echo "filter-repo: removing demo blobs from all commits"
22+
git filter-repo --invert-paths "${INVERT[@]}" --force
23+
[[ -n "$ORIGIN" ]] && git remote add origin "$ORIGIN"
24+
fi
25+
26+
if [[ -f filter-repo-replacements.txt ]]; then
27+
echo "filter-repo: replace-text from filter-repo-replacements.txt"
28+
git filter-repo --replace-text filter-repo-replacements.txt --force
29+
[[ -n "$ORIGIN" ]] && git remote add origin "$ORIGIN"
30+
fi
31+
32+
echo "History rewrite complete. Add clean demos, commit, then:"
33+
echo " git push --force-with-lease origin main"

0 commit comments

Comments
 (0)