git-codereview: allow short user names in git mail

In Mercurial, hg mail expanded Rietveld user names.
There are no Gerrit user names.
There are GitHub user names, but then I'd have to type
randall77,griesemer,robpike,ianlancetaylor
instead of khr,gri,r,iant.

The algorithm for expanding short user names is as follows:
Look at the git commit log for the current repository,
extracting all the email addresses in Reviewed-By lines
and sorting by how many times each address appears.
For each short user name, walk the list, most common
address first, and use the first address found that has
the short user name on the left side of the @.

This is a purely local operation, it adjusts automatically as
new reviewers come on board, it avoids a separate database,
it adjusts to repo-specific reviewer patterns, and it resolves
potential ambiguity in favor of the most common reviewers.
(For example, r@golang.org will beat any other r@mail.com
in the main repo.)

Change-Id: I53afea2a86ba4cfa8fd7f31d56b90a3e12cc2b48
Reviewed-on: https://go-review.googlesource.com/2111
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
4 files changed
tree: bc495c2ed5f37bd4a80c52a8e99e1412038f3164
  1. .gitattributes
  2. README
  3. git-codereview/