Skip to content

Instantly share code, notes, and snippets.

@jessfraz
Last active March 9, 2019 02:32
Show Gist options
  • Save jessfraz/04751bb0f6ef47cdd09003f58014ba24 to your computer and use it in GitHub Desktop.
Save jessfraz/04751bb0f6ef47cdd09003f58014ba24 to your computer and use it in GitHub Desktop.
stats on the go 1.7 release for fun

Setup:

# set CONTRIBUTORS file to mailmap to remove duplicate emails for the same name
# see: https://git-scm.com/docs/git-shortlog#_mapping_authors
$ git config mailmap.file CONTRIBUTORS

Top 10 contributors (all):

$ git shortlog --summary -n go1.6.3...go1.7  | head -n 10
   309  Keith Randall
   246  Josh Bleecher Snyder
   202  Brad Fitzpatrick
   176  Matthew Dempsky
   171  Ian Lance Taylor
   103  Austin Clements
   102  Robert Griesemer
    87  Todd Neal
    86  David Crawshaw
    68  Michael Munday

Top 10 contributors (non-google):

$ git shortlog --summary  --email -n go1.6.3...go1.7  | grep -v "google.com" | \
grep -v "golang.org" | head -n 10

   246  Josh Bleecher Snyder 
    87  Todd Neal 
    68  Michael Munday 
    66  Mikio Hara 
    45  Martin Mohrmann 
    38  Dave Cheney 
    30  Alex Brainman 
    28  Michael Hudson-Doyle
    27  Joe Tsai 
    25  Emmanuel Odeke 

Most changed packages: (requires git-extras)

$ git effort --above 15 src/*/*/ -- go1.6.3...go1.7
  path                                          commits    active days

  src/cmd/compile/............................. 1106        267
  src/cmd/internal/............................ 158         89
  src/cmd/link/................................ 151         66
  src/net/http/................................ 134         73
  src/cmd/go/.................................. 76          54
  src/cmd/dist/................................ 67          55
  src/cmd/asm/................................. 36          31
  src/cmd/vet/................................. 35          26
  src/crypto/x509/............................. 31          24
  src/go/build/................................ 30          26
  src/crypto/tls/.............................. 30          22
  src/cmd/cgo/................................. 30          23
  src/runtime/cgo/............................. 26          22
  src/compress/flate/.......................... 24          20
  src/go/internal/............................. 23          18
  src/runtime/testdata/........................ 22          18
  src/math/big/................................ 21          17
  src/go/types/................................ 20          18
  src/encoding/json/........................... 18          13

Top 5 commits with the most files changed:

$ git log --decorate=short -w --format="tformat:%h" --shortstat --use-mailmap --no-merges go1.6.3...go1.7 | \
sed -e ':a;N;$!ba;s/\n\n / /g' | sort -nk2 -r | head -n 5 | awk '{ print $1 }' | \
xargs git show --shortstat --oneline 

53fd522 all: make copyright headers consistent with one space after period
 923 files changed, 933 insertions(+), 933 deletions(-)
5194744 all: make copyright headers consistent with one space after period
 787 files changed, 788 insertions(+), 788 deletions(-)
5fea2cc all: single space after period.
 536 files changed, 1732 insertions(+), 1732 deletions(-)
fdd0179 all: fix typos and spelling
 92 files changed, 115 insertions(+), 115 deletions(-)
c6e11fe cmd: add new common architecture representation
 67 files changed, 639 insertions(+), 743 deletions(-)

Top 5 commits with most insertions:

$ git log --decorate=short --format="tformat:%h" --shortstat --use-mailmap --no-merges go1.6.3...go1.7 | \
sed -e ':a;N;$!ba;s/\n\n / /g' | grep insertions | sort -nk5 -r | head -n 5 |  awk '{ print $1 }' | \
xargs git show --shortstat --oneline

a347ab7 [dev.ssa] cmd/compile: split op rewrites into separate functions
 3 files changed, 15373 insertions(+), 12949 deletions(-)
93a0b0f [dev.ssa] cmd/compile: rewrites for constant shifts
 6 files changed, 13383 insertions(+), 1965 deletions(-)
786e51d cmd/compile: add generated tests for constant folding
 2 files changed, 12640 insertions(+)
f6db855 net: mirror Tom Sawyer in the net package for tests
 2 files changed, 8467 insertions(+), 2 deletions(-)
13f97ea cmd/internal/obj/s390x: add s390x support
 8 files changed, 8360 insertions(+)

Top 5 commits with most deletions:

$ git log --decorate=short --format="tformat:%h" --shortstat --use-mailmap --no-merges go1.6.3...go1.7 | \
sed -e ':a;N;$!ba;s/\n\n / /g' | grep deletions | awk '{ print $1 " " $(NF-1) }' | sort -nk2 -r | head -n 5 | \
awk '{ print $1 }' | xargs git show --shortstat --oneline

a347ab7 [dev.ssa] cmd/compile: split op rewrites into separate functions
 3 files changed, 15373 insertions(+), 12949 deletions(-)
0543447 [dev.ssa] cmd/compile/internal/ssa/gen: enclose rules' code in a for loop
 3 files changed, 2253 insertions(+), 5473 deletions(-)
036b8fd [release-branch.go1.6] cmd/newlink: remove from release branch
 40 files changed, 5267 deletions(-)
fb880b8 cmd/newlink: delete
 38 files changed, 5216 deletions(-)
2df4b9c [dev.ssa] cmd/compile/internal/ssa/gen: move variable reset code into a function
 5 files changed, 949 insertions(+), 3768 deletions(-)
@0xmohit
Copy link

0xmohit commented Sep 6, 2016

Pipes are no fun without cut and paste. So the last one could be written as:

git log --format="%h" --oneline --shortstat --use-mailmap --no-merges go1.6.3...go1.7 | paste -d\  - - | \
awk '/deletion/{print $1 " " $(NF-1)}' | sort -rn -k2 | head -5 | cut -d\  -f1 | \
xargs git show --shortstat --oneline

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