Last active
October 2, 2021 06:07
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sh <(curl https://gist.githubusercontent.com/nicksherron/bc89f35ac0eb9081d4ea58dc7af54bb6/raw/5a1377fa7218d04f91d7b20b9db0658709fb631f/labels.sh)