maintner: intern git commit messages

Many revisions of git commits in Gerrit have the same commit message.
Share that memory.

Saves 11 MB (387 MB -> 376 MB).

Change-Id: I39f05cf309404f0b1d55c296a2fe551eb501ae9c
Reviewed-on: https://go-review.googlesource.com/38718
Reviewed-by: Kevin Burke <kev@inburke.com>
diff --git a/maintner/git.go b/maintner/git.go
index 22c5168..28e0b25 100644
--- a/maintner/git.go
+++ b/maintner/git.go
@@ -270,7 +270,7 @@
 	gc := &gitCommit{
 		hash:    hash,
 		parents: make([]gitHash, 0, bytes.Count(hdr, parentSpace)),
-		msg:     string(msg),
+		msg:     c.strb(msg),
 	}
 	if commit.DiffTree != nil {
 		gc.files = commit.DiffTree.File
diff --git a/maintner/maintner.go b/maintner/maintner.go
index 1f4ff24..6f54f56 100644
--- a/maintner/maintner.go
+++ b/maintner/maintner.go
@@ -94,6 +94,13 @@
 	return s
 }
 
+func (c *Corpus) strb(b []byte) string {
+	if v, ok := c.strIntern[string(b)]; ok {
+		return v
+	}
+	return c.str(string(b))
+}
+
 func (c *Corpus) SetDebug() {
 	c.debug = true
 }