bin/git-du @ 301dff61cd7b

More
author Steve Losh <steve@stevelosh.com>
date Tue, 19 Jul 2022 12:41:40 -0400
parents (none)
children (none)
#!/usr/bin/env bash

set -euo pipefail

ROOT="$1"
shift

git-object-sizes \
    | head -200 \
    | grep -P "^\d+,\d+,[0-9a-f]+,$ROOT.*" \
    | awk --field-separator , '
    {
        sums[$4] += $1
    }
    END {
        for (x in sums) {
            print sums[x], x
        }
    }
    '