39 lines
983 B
Bash
Executable File
39 lines
983 B
Bash
Executable File
#!/bin/sh
|
|
|
|
git log --since="3 years ago" \
|
|
--numstat \
|
|
--pretty=format:"COMMIT" |
|
|
awk '
|
|
/^COMMIT/ { next }
|
|
|
|
/^[0-9]/ {
|
|
file = $3
|
|
|
|
# Keep only hand-written core code
|
|
if (file !~ /^(sw|sd|sc|vcl|desktop|framework)\//) next
|
|
|
|
# Exclude generated / mechanical code
|
|
if (file ~ /^include\/com\/sun\/star\//) next
|
|
if (file ~ /^offapi\//) next
|
|
if (file ~ /^udkapi\//) next
|
|
if (file ~ /^workdir\//) next
|
|
if (file ~ /^translations\//) next
|
|
if (file ~ /^helpcontent2/) next
|
|
if (file ~ /\.mk$/) next
|
|
if (file ~ /^configure(\.ac|\.in)?$/) next
|
|
if (file ~ /^download\.lst$/) next
|
|
if (file ~ /^solenv\//) next
|
|
|
|
commits[file]++
|
|
churn[file] += $1 + $2
|
|
}
|
|
END {
|
|
for (f in commits) {
|
|
# Sweet spot: rarely touched, but not trivial
|
|
if (commits[f] >= 3 && commits[f] <= 40 && churn[f] >= 20)
|
|
printf "%4d commits | %6d churn | %s\n",
|
|
commits[f], churn[f], f
|
|
}
|
|
}' |
|
|
sort -n
|