Skip to content

Instantly share code, notes, and snippets.

@serverhorror
Last active October 2, 2024 13:34
Show Gist options
  • Save serverhorror/04ddcdeaee82692593279c3d1d108ca7 to your computer and use it in GitHub Desktop.
Save serverhorror/04ddcdeaee82692593279c3d1d108ca7 to your computer and use it in GitHub Desktop.
git-multi-repo-statistics
#!/bin/sh
# shellcheck disable=SC2044
for repo in $(find . -mindepth 1 -maxdepth 1 -type d); do
if [ ! -d "$repo/.git" ]; then
continue
fi
(
git -C "$repo" shortlog --group=':%aE' -s
) | cat
done |
sort -k 2,2 |
awk -F ':' '{contributors[$2]+=$1} END { for (contributor in contributors) { printf("%s\t%s\n", contributors[contributor], contributor) }}' |
sort -n -r -k1,1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment