3 #=======================================================================
5 # File ID: 815ee2b8-c99a-11e2-b66c-001f3b596ec9
6 # Plot a curve to show the Git commit activity
7 # License: GNU General Public License version 2 or later.
8 #=======================================================================
10 if test "$1" = "-2"; then
12 tmpname
=$
(date +"%s").$$
13 authorfile
=/tmp
/git-plot.$
(date +"%s").$$.author.tmp
14 commitfile
=/tmp
/git-plot.$
(date +"%s").$$.commit.tmp
15 git log
--pretty="%at" "$@" |
sort -n | inc_epstat
>$authorfile
16 git log
--pretty="%ct" "$@" |
sort -n | inc_epstat
>$commitfile
17 cat <<END | gnuplot --persist
18 #!/usr/bin/gnuplot --persist
23 set format x "%Y-%m-%d %H:%M:%S"
25 set linetype 1 lc rgb "blue"
26 set linetype 2 lc rgb "red"
27 set linetype 3 lw 2 lc rgb "blue"
28 set linetype 4 lw 2 lc rgb "red"
29 plot "$commitfile" using 1:2 title "commit" w l lt 2, \
30 "$authorfile" using 1:2 title "author" w l lt 1, \
31 "$commitfile" using 1:2 title "bezier commit" s b w l lt 4, \
32 "$authorfile" using 1:2 title "bezier author" s b w l lt 3
35 tmpfile
=/tmp
/git-plot.$
(date +"%s").$$.tmp
36 git log
--pretty="%ct" "$@" | ep |
sort | inc_epstat
>$tmpfile