gitlistobjectbysize (392B)
1 #!/bin/bash -e 2 3 # work over each commit and append all files in tree to $tempFile 4 tempFile=$(mktemp) 5 IFS=$'\n' 6 for commitSHA1 in $(git rev-list --all); do 7 git ls-tree -r --long "$commitSHA1" >>"$tempFile" 8 done 9 10 # sort files by SHA1, de-dupe list and finally re-sort by filesize 11 sort --key 3 "$tempFile" | \ 12 uniq | \ 13 sort --key 4 --numeric-sort --reverse 14 15 # remove temp file 16 rm "$tempFile"