Add zsh function to list all git blobs in a repo

This commit is contained in:
don philipe
2025-09-02 13:23:45 +02:00
parent 177716cdbe
commit 3e30bb71a0

View File

@@ -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