File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -12,26 +12,20 @@ shortstats="${root}/tools/git/scripts/shortstats"
1212# - Get summary statistics for each commit.
1313# * `awk '{}'`
1414# - Tabulate the daily totals.
15- # * `sort -n`
16- # - Sort in numeric order.
17- # * `perl -pe ''`
18- # - Convert each Unix timestamp to a date string.
15+ # * `sort -k1n -k2M`
16+ # - Sort the year numerically and sort the second key as a month.
1917# * `awk '{}'`
2018# - Format the output.
2119" ${shortstats} " | awk '
22- BEGIN {
23- scalar = 60 * 60 * 24
24- }
2520{
26- # Round a Unix timestamp to the nearest day:
27- ts = int($1/scalar) * scalar
21+ day = $5 OFS $2 OFS $3
2822
2923 # Update daily totals:
30- lines[ts ] += $5
24+ lines[day ] += $9
3125}
3226END {
33- for (ts in lines) {
34- print ts OFS lines[ts ]
27+ for (day in lines) {
28+ print day OFS lines[day ]
3529 }
3630}
37- ' | sort -n | perl -pe ' s/(\d+)/localtime($1)/e ' | awk ' {print $2 OFS $3 OFS $5 OFS $6 }'
31+ ' | sort -k1n -k2M | awk ' {print $2 OFS $3 OFS $1 OFS $4 }'
You can’t perform that action at this time.
0 commit comments