Gerrit allows users to compare a patch set that is a merge commit
against a plain merge of the patch sets parents in Git. This allows
users to spot any manual modifications that the change owner might
have made.
To do so, Gerrit computes that plain merge and stores it in Git.
Previously, that merge was computed and stored when first requested.
This led to situations where Gerrit processed read requests and while
processing attempted a Git write. That slows these requests down and
makes debugging hard.
This commit changes that behavior so that we compute the auto merge
patch set synchronously when processing a git push. The ref update
is added to the existing ref transaction, so it's only created if
the push succeeds.
When retrieving auto merge commits that are missing, we compute
them in-memory. A new counter is added to track how often this
happens.
Change-Id: Iebb1a5a8d017250fa451a5ff40a12ef9b3f136a5