From 1008cee7e0c089a9350ffb96d1c9f6111eead81c Mon Sep 17 00:00:00 2001 From: structix Date: Sat, 5 Jan 2019 01:57:42 +0100 Subject: [PATCH] Added more verbosity --- gitistics.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gitistics.sh b/gitistics.sh index ae31d05..01628cc 100755 --- a/gitistics.sh +++ b/gitistics.sh @@ -26,14 +26,22 @@ function getDiffChanges() { local __delete=$3 # calculate total changes between given date and HEAD - local extractdiff=$(git diff @{"$STARTDATE"} HEAD --shortstat) 2>/dev/null + local extractdiff=$(git diff @{"$STARTDATE"} HEAD --shortstat 2>/dev/null) # set the separator to , local IFS=',' local array=( $extractdiff ) - local f=$(( ${array[0]//[!0-9]} + __files)) - local i=$(( ${array[1]//[!0-9]} + __insert)) - local d=$(( ${array[2]//[!0-9]} + __delete)) + + # Parse the numbers + local extf=${array[0]//[!0-9]} + local exti=${array[1]//[!0-9]} + local extd=${array[2]//[!0-9]} + + echo "Files: $extf, Insertions: $exti, Deletions: $extd" + + local f=$(( extf + __files)) + local i=$(( exti + __insert)) + local d=$(( extd + __delete)) eval $__files="'$f'" eval $__insert="'$i'"