git-cal

Faire un calendrier d'activité git avec gnuplot - retour accueil

git clone git://bebou.netlib.re/git-cal
Log | Files | Refs | README |

commit 9773719f8509ba409717778efdec14ab1070e2f1
parent b4652f57fef51e33beafda76bd0559126c1aab65
Auterice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Mon, 21 Oct 2024 21:27:32 +0200

Simplification du masquage des premiers jours

Plus besoin d'une colonne dédiée tant que dans la deuxième il n'existe
qu'un seul mot pour les jours que l'on veut masquer

Diffstat:
Mcountcommits.sh | 4++--
Mgraph.gp | 25++++++++++++++-----------
Mmakefile | 6++----
3 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/countcommits.sh b/countcommits.sh @@ -14,13 +14,13 @@ done | for d in $(seq 365 -1 0);do day=$(LC_ALL=C date --date "today - $d days" +"$dateformat") res=$(grep "$day" $t) - [ -n "$res" ] && echo "$res 1" || echo "0 $day 1" + [ -n "$res" ] && echo "$res" || echo "0 $day" done > $l firstday=$(head -n1 $l | cut -f2 | cut -c1) for d in $(seq 1 $(( $firstday - 1 )) );do - printf "0 %s 0\n" $d + printf "0 %s\n" $d done cat $l diff --git a/graph.gp b/graph.gp @@ -1,24 +1,27 @@ #! /usr/bin/gnuplot +set term pngcairo width=2000 -gap=0.80 +set term pngcairo size width,(width/(52/7)) set datafile separator "\t" + set tmargin 1 set lmargin 6.5 -set term pngcairo size width,(width/(52/7)) -set border 0;unset tics;unset key;unset colorbox +x(nl) = floor(nl/7) +y(nl) = int(nl*-1)%7 -set style fill solid -set palette defined ( 0 "light-grey", 1 "light-blue", 20 "blue", 50 "dark-blue" ) +set border 0 +unset key +unset tics +unset colorbox -xlow(nl) = floor(nl/7) -ylow(nl) = int(nl*-1)%7 +set palette defined ( 0 "light-grey", 1 "light-blue", 20 "blue", 50 "dark-blue" ) set label "Mon" at -1.5, 0 set label "Sun" at -1.5,-6 -plot 'nbofcommits.dat' \ - u ($3==1 ? xlow($0):NaN):(ylow($0)):1 \ - w p pt 5 ps 4 lc palette, \ -'' u (xlow($0)):(word(strcol(2),4) eq "01" ? 1.3:NaN):(word(strcol(2),3)) w labels +plot 'nbofcommits.tsv' u (words(strcol(2))>1 ? x($0):NaN):(y($0)):1 \ + with points \ + pointtype 5 pointsize 5 linecolor palette, \ +'' u (x($0)):(word(strcol(2),4) eq "01" ? 1.3:NaN):(word(strcol(2),3)) w labels diff --git a/makefile b/makefile @@ -3,11 +3,9 @@ author=".*arthur.*" all: graph.png -graph.png: nbofcommits.dat graph.gp +graph.png: nbofcommits.tsv graph.gp ./graph.gp > $@ -nbofcommits.dat: countcommits.sh +nbofcommits.tsv: countcommits.sh ./countcommits.sh ${gitfolder} ${author} > $@ -#.PHONY: nbofcommits.dat -