sqlite3 $< "SELECT DISTINCT(author) FROM commits" |
while read author; do
echo "\n# $${author} Worklog"
echo "Report Generated\n: $${now}\n"
echo "Repository Version\n: $${ver}\n"
sqlite3 $< "SELECT DISTINCT strftime('%Y-%m', date) FROM commits WHERE author='$${author}'" |
while read month; do
echo "\n## $$(LANG=en_US date +'%B %Y' -d $${month}-01)"
echo '``` table'
echo '---\nheader: True\n---'
sqlite3 --header -csv $< "SELECT file as Filename, SUM(added) AS Added, SUM(-removed) AS Removed FROM commits WHERE author='$${author}' and strftime('%Y-%m', date)='$${month}' GROUP BY Filename"
echo '```'
echo -n "Net Characters Added\n: "
sqlite3 $< "SELECT SUM(added+ -removed) FROM commits WHERE author='$${author}' and strftime('%Y-%m', date)='$${month}'"