etc/gitstats.rb: rewrite logic

Use for-each-ref to get tags, instead of constructing by hand.