File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -11,19 +11,18 @@ shortstats="${root}/tools/git/scripts/shortstats"
1111# * `shortstats`
1212# - Get summary statistics for each commit.
1313# * `awk '{}'`
14- # - Extract the commit timestamp and number of additions.
15- # * `perl -pe ''`
16- # - Convert each Unix timestamp to a date string.
17- # * `awk '{}'`
1814# - Tabulate the monthly totals.
19- # * `sort -M`
20- # - Sort by month name.
21- " ${shortstats} " | awk ' {print $1 OFS $5}' | perl -pe ' s/(\d+)/localtime($1)/e' | awk '
15+ # * `sort -k1n -k2M`
16+ # - Sort the year numerically and sort the second key as a month.
17+ # * `awk '{}'`
18+ # - Format the output.
19+ " ${shortstats} " | awk '
2220{
23- lines[$2] += $6
21+ mon = $5 OFS $2
22+ lines[mon] += $9
2423}
2524END {
2625 for (mon in lines) {
2726 print mon OFS lines[mon]
2827 }
29- }' | sort -M
28+ }' | sort -k1n -k2M | awk ' {print $2 OFS $1 OFS $3} '
You can’t perform that action at this time.
0 commit comments