3 #=======================================================================
5 # File ID: 6d9eb5a8-2526-11e4-be0d-c80aa9e67bbd
7 # License: GNU General Public License version 2 or later.
8 #=======================================================================
10 outfile
=/tmp
/git-authors.txt
12 git log
--format="%ci %aN" "$@" | \
19 perl
-pe 's/^(\d+)\s(\S+)/$2 $1/' >$outfile
21 firstyear
=$
(head -1 $outfile | cut
-f 1 -d -)
23 for y
in $
(seq $firstyear $curryear); do
24 for m
in $
(seq -w 1 12); do
25 grep -q ^
$y-$m $outfile ||
echo $y-$m 0 >>$outfile
28 sort $outfile >${outfile}.tmp
29 mv ${outfile}.tmp
$outfile
31 headzero
="$(cut -f 2 -d ' ' $outfile | uniq -c | rmspcall | head -1 | grep ' 0$')"
32 if test -n "$headzero"; then
33 numhead
=$
(echo $headzero | cut
-f 1 -d ' ')
34 linecount
=$
(wc -l <$outfile)
35 tail -n -$
[$linecount - $numhead] $outfile >${outfile}.tmp
36 mv ${outfile}.tmp
$outfile
39 tailzero
="$(cut -f 2 -d ' ' $outfile | uniq -c | rmspcall | tail -1 | grep ' 0$')"
40 if test -n "$tailzero"; then
41 numtail
=$
(echo $tailzero | cut
-f 1 -d ' ')
42 linecount
=$
(wc -l <$outfile)
43 head -n $
[$linecount - $numtail] $outfile >${outfile}.tmp
44 mv ${outfile}.tmp
$outfile
47 stpl
-f %Y-
%m
$outfile