Fix checkArgument placeholder in CommentsInNotesUtil

checkArgument accepts only %s as a placeholder.
%d is not valid and will fail if the check fails.

Change-Id: I24c9a989d2d95fcf82a73d8cf7dd670cce21ed61
Remove unnecessary parens from CommentsInNotesUtil

There is nothing ambiguous here that requires additional parens to
show order of operations to the reader, or javac.

Change-Id: Ie838b2b638344efced34117034ed4c7082ca234a
Cleanup CommentsInNotesUtil to read larger notes

The default read limit inside of JGit is usually around 1-5 MiB,
after which the reader will fail to supply content unless the
caller is streaming.

Callers should supply their own maximum sane read limit.  Cap it here
at 25 MiB worth of formatted comments per commit on a change.  Notes
larger than this will fail to read into a server, stopping unexpected
memory explosion.

Callers that won't modify the data are encouraged to use the faster
getCachedBytes() method, which does not copy before returning.

Insert is overloaded to handle the entire byte array, allowing
the note to be written in one line of code.

Change-Id: Id3b197edb9fddb15d00d62dbe9b6c2b2c08ad9d1
Fix s/no/not/ typo in GetReflog

Change-Id: I80ed2f492a7c346447cdb5f2aeb002bfffbad9de
BanCommit: Don't @Inject members

Change-Id: Ie15c8c387ee8ee88607c970539fd7d1fa070c7de
Be more efficient about loading banned commits map

We always have a RevWalk available at call sites, so reuse that.

Don't reload the notes on every call to the validator; there may be
many such calls when used from ReceiveCommits. Since ReceiveCommits
already has a NoteMap available, just plumb that down.

Note that we can't simply remove the NoteMap from ReceiveCommits, as
the absence of any banned commits is one of the things used to tell
whether we can short-circuit all commit validation.

Change-Id: Ib8ba2360c45c106fd1ded54ea392bfcb8d98fff7
Don't leak IOException error messages from CommitValidators

These may leak low-level implementation details that are useless to
end users. Log instead.

Change-Id: I86e81d2b9f0c3dcef7f88f234bb8eef83e582595
BanCommit: Only record timezone from server identity

If we really want to use the server identity from a singleton we
should use a Provider, which will evaluate to the current time.
However, in this case we just need the timezone for constructing an
identity from the current user. Make this explicitly the only
dependency.

Change-Id: Iba29d2a5dddb17eb5a9803fc1bf7bbfc06e0f4d9
BanCommit: Improve error message and comment wording.

Change-Id: I95cf44644acf67c4d775d898f48425b1533a4611
BanCommit: Only create banned note content once

The JGit DFS backend will happily write out duplicate objects in an
inserter, so we need to avoid this at the caller level.

Change-Id: If4cb00ba0ebc64f422010053379e1f713229bc5b