Collect stats for all branches, not just HEAD

We typically merge most of our work at Causes directly to the master
branch of our various projects, but this is not always true, especially
in the wider community, so let's do the equivalent of `git log --all`
rather than just `git log`.

Change-Id: I644bf6118ef4d0e7339e1686f94c464f046c6b72
Reviewed-on: https://gerrit.causes.com/24877
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Use IO.popen instead of backticks

With IO.popen, we don't have to worry about shell escaping, as there is
no intervening shell. This in turn will make us more robust in the face
of odd things like spaces in paths.

Change-Id: Ib815192d6a97e33e035438c3f2316e401e20a55d
Reviewed-on: https://gerrit.causes.com/24882
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Memoize Twig::Repo#commits results

Retrieving the commits for a repo is a potentially costly operation, so
memoize the results, keyed on the `options`. We don't currently hit this
method multiple times in a specific run, but we will likely want to do
so for the web app in the near future; we might want some notion of
expiry as well, but we'll add that when and if we need it.

Change-Id: I03a6ab1a12cd455fef4e9f00b00a502bbf3ac5ae
Reviewed-on: https://gerrit.causes.com/24881
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Fix and clean-up stat output

This commit makes the stat output more readable by:

  - trusting the commit subject line to be responsibly formatted (ie. we
    don't worry about truncating or aligning), and putting the repo name
    label immediately after the subject line
  - switching to string substitution for the stat numbers, which means
    that no longer have "+0" showing up where we would expect "-0"
  - fixed some off-by-one mis-indentation

Change-Id: Ifb9a028a9d5b8da44531f07bed75157d7b4291f7
Reviewed-on: https://gerrit.causes.com/24883
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>