mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 06:26:39 +00:00
feat(git): add git-largest-objects helper
This commit is contained in:
13
zsh/git.zsh
Normal file
13
zsh/git.zsh
Normal file
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# git
|
||||
#
|
||||
|
||||
# Stolen from: https://stackoverflow.com/a/42544963
|
||||
git-largest-objects() {
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user