gitstats: Optimizations to the 'belongs to' metric
On the git.git repository there are a lot of 'strange' tree
structures, in which the same commits are often refered to
by multiple different other commits. As a result, if we do
not take measures against this, a lot of the same history
is checked multiple times. Especially in the git.git repo
this means the algorithm takes an insanely long amount of
time to finish. This commit introduces a 'memory' that
stores which commits have already been checked, and as such
should not be checked again.
To help debugging the information printed when the '-d'
flag is specified has been increased, the '-d' flag now
doubles as a '--verbose' flag. Not only debug information
is printed, but also information on which branch is
currently being examined.