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 e2271485fdc3ae2a066288c17d8d7459f1fd7177
parent 42ed4410ed07dfd6b962de8fcb2028ce6856bcaa
Auterice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Mon, 21 Oct 2024 18:55:36 +0200

Affichage des mois sur le graph

Ajout du nom du mois dans la source de donnée pour pouvoir l'afficher
sur le graph

Diffstat:
Mcountcommits.sh | 9+++++----
Mgraph.gp | 8+++++++-
2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/countcommits.sh b/countcommits.sh @@ -2,16 +2,17 @@ t=$(mktemp) l=$(mktemp) +dateformat="%u %Y %b %d" for dep in $(find "${1:?folder ?}/"* -maxdepth 0 -type d );do cd $dep - git log --date=format:"%u %Y-%m-%d" --author="${2:?author name ?}" | grep Date: + LC_ALL=C git log --date=format:"$dateformat" --author="${2:?author name ?}" | grep Date: done | - awk '{print $2,$3}' | + cut -d ' ' -f2- | sort | uniq -c | sort -n | - awk '{print $1" "$2,$3}' > $t + sed -E 's, *([0-9]+) *,\1 ,' > $t for d in $(seq 365 -1 0);do - day=$(LC_ALL=C date --date "today - $d days" +"%u %Y-%m-%d") + day=$(LC_ALL=C date --date "today - $d days" +"$dateformat") res=$(grep "$day" $t) [ -n "$res" ] && echo "$res 1" || echo "0 $day 1" done > $l diff --git a/graph.gp b/graph.gp @@ -3,6 +3,8 @@ width=2000 gap=0.80 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 @@ -13,6 +15,10 @@ set palette defined ( 0 "light-grey", 1 "light-blue", 20 "blue", 50 "dark-blue" xlow(nl) = floor(nl/7) ylow(nl) = int(nl*-1)%7 +set label "Mon" at -1.5, 0.5 +set label "Sun" at -1.5,-5.5 + plot 'nbofcommits.dat' \ u (0):($3==0 ? NaN:0):(xlow($0)):(xlow($0)+gap):(ylow($0)):(ylow($0)+gap):1 \ - w boxxy lc palette + w boxxy lc palette, \ +'' u (xlow($0)+0.45):(word(strcol(2),4) eq "01" ? 1.3:NaN):(word(strcol(2),3)) w labels