Added another shity script
This commit is contained in:
parent
32d2e1a5f6
commit
0e4c7da82f
1 changed files with 29 additions and 0 deletions
29
svn-log-count/svn-log-count.sh
Executable file
29
svn-log-count/svn-log-count.sh
Executable file
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue