git-codereview: rewrite issue references

We have a single repo against which all issues are filed.
GitHub supports closing issues in other repos,
but it is easy to forget to use the magic syntax.
To fix that, rewrite issue references in the commit msg hook.

To that end, introduce a repo-level config file,
located at REPOROOT/codereview.cfg.
The config is always read from origin/master.
Config lines are of the form "key: value".
Lines beginning with # are comments.

To designate a repo as the issues repo, add

issuerepo: USERNAME/REPO

to the config.

Fixes golang/go#9273.

Change-Id: I31ec98883641bbf0c149f3619769231f6a452512
Reviewed-by: Andrew Gerrand <>
Reviewed-by: Russ Cox <>
5 files changed