mirror of
https://github.com/don-philipe/dotfiles.git
synced 2025-11-08 14:47:03 +01:00
Add zsh function to list all git blobs in a repo
This commit is contained in:
@@ -59,6 +59,18 @@ m4a2mp3()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Show all blob objects in repo sorted from smalles to largest
|
||||||
|
# https://stackoverflow.com/a/42544963
|
||||||
|
git-blobs()
|
||||||
|
{
|
||||||
|
git rev-list --objects --all --missing=print |
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
# show the current mode:
|
# show the current mode:
|
||||||
#PR_VIMODE="#"
|
#PR_VIMODE="#"
|
||||||
#function zle-keymap-select
|
#function zle-keymap-select
|
||||||
|
|||||||
Reference in New Issue
Block a user