From 04d8f0a6f7886c37de0053852649688a4ffff603 Mon Sep 17 00:00:00 2001
From: Ben Sima <ben@bsima.me>
Date: Mon, 9 Mar 2020 15:47:26 -0700
Subject: Add git-author-stats

via: https://github.com/jb55/bin/blob/master/git-author-stats
---
 git-author-stats | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100755 git-author-stats

diff --git a/git-author-stats b/git-author-stats
new file mode 100755
index 0000000..8bd2d9b
--- /dev/null
+++ b/git-author-stats
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+
+script=$(cat << 'EOF'
+NF == 1 { name = $1; commits[name] += 1 }
+NF == 3 { plus[name] += $1; minus[name] += $2 }
+END {
+  for (name in plus) {
+    print name "\t+" plus[name] "\t-" minus[name] "\t" commits[name]
+  }
+}
+EOF
+)
+
+(printf $'name\tadded\tremoved\tcommits\n';
+
+git log --numstat --pretty=$'%aN' "$@" \
+    | awk -F$'\t' "$script" \
+    | sort --field-separator=$'\t' -k${ASTATS_SORT_COLUMN:-2} -gr
+) > /tmp/git-author-stats
+
+column -t -s $'\t' /tmp/git-author-stats
+rm /tmp/git-author-stats
-- 
cgit v1.2.3