Skip to content

Instantly share code, notes, and snippets.

@marcan
Last active October 24, 2022 12:25
Show Gist options
  • Save marcan/b4328c490ff4f4f6d45509ac117edb93 to your computer and use it in GitHub Desktop.
Save marcan/b4328c490ff4f4f6d45509ac117edb93 to your computer and use it in GitHub Desktop.
Asahi Linux patch stats
#!/bin/sh
set -e
ROOT=remotes/origin
total=0
for i in $(git for-each-ref --format="%(refname:short)" refs/$ROOT/bits/); do
name="${i##*/}"
base=$ROOT/base
if git rev-parse --verify "$ROOT/bases/$name" &>/dev/null; then
base="$ROOT/bases/$name"
fi
count="$(git rev-list $base..$i | wc -l)"
printf "%20s %d\n" "$name" "$count"
total=$((total+count))
done
echo
printf "%20s %d\n" "TOTAL" "$total"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment