Skip to content

Instantly share code, notes, and snippets.

@foriequal0
Last active March 29, 2022 08:56
Show Gist options
  • Save foriequal0/b7b1a609df775ac98a7b560607916401 to your computer and use it in GitHub Desktop.
Save foriequal0/b7b1a609df775ac98a7b560607916401 to your computer and use it in GitHub Desktop.
Git author stat
#!/usr/bin/bash
set -euo pipefail
git shortlog -s | cut -c8- | while read -r AUTHOR; do
git log --author="$AUTHOR" --pretty=tformat: --numstat --ignore-all-space -- . \
| gawk -v AUTHOR="$AUTHOR" '{ add += $1; subs += $2; } END { printf "%s, %s, %s\n", AUTHOR, add, subs }' -
done
#!/usr/bin/bash
set -euo pipefail
git ls-files -z -- . | sed 's/^/.\//' | xargs -0 -n1 git blame -w \
--line-porcelain HEAD |grep -ae "^author " | sort | uniq -c | sort -nr
@foriequal0
Copy link
Author

-- .-- . ':(exclude)some/vendored/dir' 같은걸로 변경하면 일부 큰 파일들을 무시할 수 있음.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment