dotfiles/home/private_dot_config/zsh/functions/executable_large-git

11 lines
408 B
Text
Raw Normal View History

2024-06-10 15:40:43 -05:00
#!/usr/bin/env zsh
# https://stackoverflow.com/questions/10622179/how-to-find-identify-large-commits-in-git-history
git rev-list --objects --all |
git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' |
sed -n 's/^blob //p' |
sort --numeric-sort --key=2 |
cut -c 1-12,41- |
$(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest