Skip to content

Instantly share code, notes, and snippets.

@zph
Last active August 29, 2015 14:05
Show Gist options
  • Save zph/74dd33c7a619e3e1b2e6 to your computer and use it in GitHub Desktop.
Save zph/74dd33c7a619e3e1b2e6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -eou pipefail
readonly BRANCH="$1"
readonly GIT_USER="$(git config --get user.email)"
# Thanks to @eevee
git log --pretty=tformat: --numstat --author="$GIT_USER" "$BRANCH" |awk -F '\t' '/./{a+=$1;r+=$2;f[$3]=1}END{printf"%d; +%d -%d = %d\n",length(f),a,r,a-r}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment