Teach Repo to respect .mailmap
Teach Repo to respect .mailmap

Ideally I'd be able to pass `--use-mailmap` to our log command and
everything would continue to function as normal, but alas,
`--format=raw` trumps that, leading it to have no effect.

So, we use a custom "format" instead. This lead me to rewrite the
parser, seeing as I could control the output to return exactly what I
needed and nothing else.

While at it, I decided to make it use an enumerator so as to avoid
reading the entire Git output into memory at once. This makes the code a
little more complicated, because it has us passing blocks around, but on
the bright side it should be faster and the parser code itself is
arguably cleaner and easier to read now.

That's the theory, anyway. The practice reveals the approach to be about
half as fast. Presumably this is because there is overhead in managing
the enumerator (perhaps it does something stupid behind the scenes like
array-ifying the input before beginning enumeration) and the all-at-once
approach benefits from being able to compile the regex up front and then
power through the input.

I'll leave this commit as-is for posterity, but I'm going to go back in
presently and make things fast again (hopefully) by replacing the
enumerator.

Change-Id: I9a1b79982dd6a9a2f36546324a6d4e0bc15ba1af
Reviewed-on: https://gerrit.causes.com/25829
Reviewed-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com>
Tested-by: Greg Hurrell <79e2475f81a6317276bf7cbb3958b20d289b78df@causes.com>

causes/twigg,causes/twigg