bin/git-du @ eb9f31c299b8

Merge
author Steve Losh <steve@stevelosh.com>
date Tue, 02 Jul 2024 10:03:59 -0400
parents 301dff61cd7b
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
        }
    }
    '