Skip to content

Instantly share code, notes, and snippets.

@nicksherron
Last active October 2, 2021 06:07
Show Gist options
  • Select an option

  • Save nicksherron/bc89f35ac0eb9081d4ea58dc7af54bb6 to your computer and use it in GitHub Desktop.

Select an option

Save nicksherron/bc89f35ac0eb9081d4ea58dc7af54bb6 to your computer and use it in GitHub Desktop.
Git blame of all label usage in go std library using ripgrep, awk and git.
#!/usr/bin/env sh
tmp=$(mktemp -d -t `date +%s`)
cd $tmp
git clone https://github.com/golang/go
cd go
files=$(rg -n -s '^\S+:\n' --type=go --glob='!*test*' --glob='!*internal*' --glob='!*vendor*' --glob='!*doc.go')
for i in `echo $files`; do
echo $i | awk 'BEGIN { FS=":"} /1/ {print $1 " -L " $2","$2} ' | xargs git --no-pager blame ;
done
@nicksherron

nicksherron commented Oct 2, 2021

Copy link
Copy Markdown
Author
 sh <(curl https://gist.githubusercontent.com/nicksherron/bc89f35ac0eb9081d4ea58dc7af54bb6/raw/5a1377fa7218d04f91d7b20b9db0658709fb631f/labels.sh)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   347  100   347    0     0   1591      0 --:--:-- --:--:-- --:--:--  1591
Cloning into 'go'...
remote: Enumerating objects: 496987, done.
remote: Counting objects: 100% (32/32), done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 496987 (delta 2), reused 1 (delta 1), pack-reused 496955
Receiving objects: 100% (496987/496987), 267.38 MiB | 44.80 MiB/s, done.
Resolving deltas: 100% (395872/395872), done.
Updating files: 100% (10656/10656), done.
a1e7cd97d50 src/pkg/exp/regexp/syntax/prog.go (Russ Cox 2011-07-24 17:00:28 -0400 170) Loop:
1a4681ed745 src/pkg/exp/regexp/syntax/parse.go (Russ Cox 2011-06-14 14:30:10 -0400 1248) Switch:
b4117995e3e (Ian Lance Taylor 2016-03-23 17:10:18 -0700 312) FindName:
6121987a10b (Russ Cox 2018-07-28 20:25:06 -0400 148) BigCmdLoop:
f277ebfc761 src/pkg/debug/gosym/symtab.go (Russ Cox 2009-09-01 16:11:17 -0700 613) pathloop:
a376435ae54 (Russ Cox 2018-10-02 10:23:58 -0400 318) Again:
60b29711804 (Russ Cox 2018-10-02 09:29:47 -0400 501) Return:
639a20da908 (Richard Miller 2016-04-29 17:39:33 +0100 174) dirloop:
639a20da908 (Richard Miller 2016-04-29 17:39:33 +0100 289) childerror1:
e410a527b20 (Keith Randall 2015-11-07 21:28:21 -0800 413) bufrecv:
1d8fa7fa5db src/pkg/runtime/select.go (Keith Randall 2014-09-02 14:13:29 -0700 491) retc:
d58593d8aa3 (Martin Möhrmann 2018-01-27 12:38:13 +0100 113) again:
4b05c01f9ce (Keith Randall 2018-10-15 15:14:48 -0700 124) bucketloop:
d58593d8aa3 (Martin Möhrmann 2018-01-27 12:38:13 +0100 174) done:
4b05c01f9ce (Keith Randall 2018-10-15 15:14:48 -0700 214) bucketloop:
a2cd2bd55d1 (Michael Anthony Knyszek 2019-09-16 21:23:24 +0000 1213) HaveSpan:
4e5ed83e8d2 (Keith Randall 2020-07-03 11:28:50 -0700 162) outer:
f93e21ac249 src/pkg/runtime/sigqueue.go (Russ Cox 2014-09-05 14:38:29 -0400 100) Send:
0b0cc4154e1 src/runtime/hashmap.go (Josh Bleecher Snyder 2017-08-23 07:49:25 -0700 719) search:
7c2b1597c67 src/pkg/runtime/softfloat64.go (Russ Cox 2010-10-25 17:55:50 -0700 462) again1:
91a670d179a src/pkg/runtime/netpoll_epoll.go (Dmitriy Vyukov 2014-09-04 10:04:04 +0400 126) retry:
a13691966ad (Michael Anthony Knyszek 2020-02-20 20:58:45 +0000 167) havespan:
49ea9207b65 (Austin Clements 2016-10-30 20:20:17 -0400 1066) done:
9582b6e8fd1 (Michael Anthony Knyszek 2020-02-20 21:28:02 +0000 143) claimLoop:
9f78aa77443 (Clément Chigot 2018-09-28 14:54:43 +0200 166) retry:
91a670d179a src/pkg/runtime/netpoll_kqueue.go (Dmitriy Vyukov 2014-09-04 10:04:04 +0400 127) retry:
1c4f3c5ea02 (Austin Clements 2017-04-03 15:47:11 -0400 721) retry:
e9c57d8a2d7 src/runtime/os_plan9_386.go (David du Colombier 2014-11-21 19:39:01 +0100 122) Throw:
e9c57d8a2d7 src/runtime/os_plan9_386.go (David du Colombier 2014-11-21 19:39:01 +0100 140) Exit:
f30a2b9ca7c (Dmitry Vyukov 2014-12-12 18:11:27 +0100 817) Search:
38255cbd1b0 (David Chase 2015-12-09 11:45:36 -0500 194) again:
d58593d8aa3 (Martin Möhrmann 2018-01-27 12:38:13 +0100 113) again:
4b05c01f9ce (Keith Randall 2018-10-15 15:14:48 -0700 124) bucketloop:
d58593d8aa3 (Martin Möhrmann 2018-01-27 12:38:13 +0100 174) done:
4b05c01f9ce (Keith Randall 2018-10-15 15:14:48 -0700 214) bucketloop:
d58593d8aa3 (Martin Möhrmann 2018-01-27 12:38:13 +0100 174) dohash:
feb8a3b6169 (Russ Cox 2015-05-04 11:30:10 -0400 1284) Phase3:
512f75e8dfc (Russ Cox 2015-05-08 01:43:18 -0400 1321) Phase4:
512f75e8dfc (Russ Cox 2015-05-08 01:43:18 -0400 1600) Run:
0ddfe70c273 src/pkg/xml/read.go (Russ Cox 2009-10-05 15:10:00 -0700 510) Loop:
78961ed961f src/pkg/path/match.go (Russ Cox 2010-02-24 16:11:14 -0800 100) Scan:
eff2b2620db (Austin Clements 2017-06-16 15:54:21 -0400 1499) found:
2cc17bc5f20 (Daniel Martí 2018-11-23 16:56:23 +0000 317) Switch:
89ccfe49622 (Joe Tsai 2017-10-20 05:26:43 -0700 313) parseField:
cde6a675bcc (Rob Findley 2021-04-01 12:23:22 -0400 401) exit:
54f854fb415 (Rob Findley 2021-06-07 19:50:15 -0400 1081) parseElements:
741eab4eb65 src/pkg/compress/lzw/writer.go (Nigel Tao 2011-02-25 09:20:04 +1100 143) loop:
7f52b43954d (Conrad Irwin 2016-02-19 10:12:44 -0800 619) Loop:
e5d9cafbe8a (Nigel Tao 2015-06-30 14:02:04 +1000 141) loop:
5fc4decd10a (Joe Tsai 2015-10-31 11:22:42 -0700 491) readLiteral:
d8b7bd6a1f8 (Nigel Tao 2016-04-26 19:16:30 +1000 191) emitRemainder:
40c2fbf4f2d src/pkg/net/interface_linux.go (Mikio Hara 2013-02-20 08:18:04 +0900 146) loop:
68bf5666cdc src/pkg/net/lookup_plan9.go (Nicolas Owens 2014-02-13 10:26:16 -0500 158) loop:
254964074f3 src/go/exact/exact.go (Robert Griesemer 2015-04-06 18:23:51 -0700 1007) Error:
254964074f3 src/go/exact/exact.go (Robert Griesemer 2015-04-06 18:23:51 -0700 1263) Error:
5fb7e5b482e src/pkg/go/printer/printer.go (Robert Griesemer 2011-12-13 14:05:05 -0800 1169) unsupported:
7a3dcd2d0f3 (Brad Fitzpatrick 2015-10-14 03:37:10 +0000 3110) Error:
254964074f3 (Robert Griesemer 2015-04-06 18:23:51 -0700 1505) Error:
d1ba047edfa (Robert Findley 2021-08-16 13:20:29 -0400 178) loop:
359ca5ccc8b (Robert Griesemer 2017-03-01 17:15:43 -0800 71) cmd/compile:
c21ba09bcd8 (Filippo Valsorda 2018-11-02 00:57:30 -0400 174) GroupSelection:
7d61ad25f8b (Adam Langley 2018-05-16 14:35:23 -0700 1062) NextCert:

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