From 0e4c7da82f36c3e9a21305a607cfc36a293455ab Mon Sep 17 00:00:00 2001 From: "Marcel Kapfer (mmk2410)" Date: Fri, 9 Dec 2016 19:26:33 +0100 Subject: [PATCH] Added another shity script --- svn-log-count/svn-log-count.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 svn-log-count/svn-log-count.sh diff --git a/svn-log-count/svn-log-count.sh b/svn-log-count/svn-log-count.sh new file mode 100755 index 0000000..5daa32c --- /dev/null +++ b/svn-log-count/svn-log-count.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +dates=$(svn log | grep "^r" | grep "|" | cut -d'|' -f3 | cut -d' ' -f2) + +# get total amount of commits + +echo "Sum: $(echo "$dates" | wc -l)" + +# get first year + +for curyear in $(echo "$dates" | cut -d'-' -f1); do + if [[ -z $year ]]; then + year=$curyear + fi + if [[ $curyear -lt $year ]]; then + year=$curyear + fi +done + +echo "First Commit (Year): $year" + + +# get amount of commits per year + +while [[ $year -le $(date +"%Y") ]]; do + echo "Sum for $year: $(echo "$dates" | grep "^$year" | wc -l)" + year=$((year+1)) +done +