Skip to content

Instantly share code, notes, and snippets.

@vilfu
Last active September 26, 2019 21:41
Show Gist options
  • Select an option

  • Save vilfu/c1974a273cb6f9409d10735c33f470ac to your computer and use it in GitHub Desktop.

Select an option

Save vilfu/c1974a273cb6f9409d10735c33f470ac to your computer and use it in GitHub Desktop.
Most net negative commit
git log --shortstat --no-merges --pretty=format:"%h %ae" | awk '{ if (NF == 2) { commit=$1; author=$2 }; if (NF == 7) { removed=$6; if (deletions[author] < removed) {deletions[author]=removed; commits[author]=commit;}; }; if (NF == 5 && $5~/deletions/) { removed=$4; if (deletions[author] < removed) {deletions[author]=removed; commits[author]=commit;}; }; } END { for (author in deletions) { print "-"deletions[author]"\t"commits[author]"\t"author;} }' | sort -n | head -n10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment