21 lines
660 B
Awk
21 lines
660 B
Awk
# derive.awk -- recompute the wizard-work per-lane census from git ls-tree.
|
|
# Input: `git ls-tree -r -l HEAD` lines: mode type object size path
|
|
# (default whitespace FS; $1=mode $2=type $3=object $4=size $5=path).
|
|
# Group by lane (second path component under wizard-work/).
|
|
$5 ~ /^wizard-work\// {
|
|
split($5, a, "/");
|
|
lane = a[2];
|
|
cnt[lane]++;
|
|
tot[lane] += $4;
|
|
tcount++;
|
|
tbytes += $4;
|
|
}
|
|
END {
|
|
split("beam forge ledger null quill sol spark sphinx volt zeph", lanes, " ");
|
|
for (i = 1; i in lanes; i++) {
|
|
l = lanes[i];
|
|
if (l in cnt) print l "\t" cnt[l] "\t" tot[l];
|
|
}
|
|
print "TOTAL\t" tcount "\t" tbytes;
|
|
}
|