File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # Prints the number of files changed per weekday.
4
+
5
+ # Determine root directory:
6
+ root=" $( git rev-parse --show-toplevel) "
7
+
8
+ # Define the path to a utility to generate commit short stats:
9
+ shortstats=" ${root} /tools/git/scripts/shortstats"
10
+
11
+ # * `shortstats`
12
+ # - Get summary statistics for each commit.
13
+ # * `awk '{}'`
14
+ # - Extract the commit timestamp and number of files changed.
15
+ # * `perl -pe ''`
16
+ # - Convert each Unix timestamp to a date string.
17
+ # * `awk '{}'`
18
+ # - Tabulate the weekday totals.
19
+ " ${shortstats} " | awk ' {print $1 OFS $4}' | perl -pe ' s/(\d+)/gmtime($1)/e' | awk '
20
+ BEGIN {
21
+ split("Mon Tue Wed Thu Fri Sat Sun", days);
22
+ }
23
+ {
24
+ lines[$1] += $6
25
+ }
26
+ END {
27
+ for ( i = 1; i <= 7; i++ ) {
28
+ print days[i] OFS lines[days[i]]
29
+ }
30
+ }'
You can’t perform that action at this time.
0 commit comments