File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ #
3+ # Prints summary statistics for each year.
4+ #
5+ # <year> <files_changed> <additions> <deletions>
6+
7+ # Determine root directory:
8+ root=" $( git rev-parse --show-toplevel) "
9+
10+ # Define the path to a utility to generate commit short stats:
11+ shortstats=" ${root} /tools/git/scripts/shortstats"
12+
13+ # * `shortstats`
14+ # - Get summary statistics for each commit.
15+ # * `awk '{}'`
16+ # - Tabulate the yearly totals.
17+ # * `sort -k1n`
18+ # - Sort the year numerically.
19+ " ${shortstats} " | awk '
20+ {
21+ # Update yearly totals:
22+ files[$5] += $8
23+ additions[$5] += $9
24+ deletions[$5] += $10
25+ }
26+ END {
27+ for (yr in files) {
28+ print yr OFS files[yr] OFS additions[yr] OFS deletions[yr]
29+ }
30+ }
31+ ' | sort -k1n
You can’t perform that action at this time.
0 commit comments