It seems to require some big changes in Gerrit. Right now Gerrit only
considers the commits transferred over the network as negotiated by the
Git network protocol. That usually means objects that the server doesn't
yet know about (but the negotiation is simple and limited, upon
connection the server sends to the client a limited list of its refs and
SHA1s similar to what "git ls-remote" does and the client, if it
knows those SHA1s, can determine what to send and not send, of course it
easily can fail and send too much).
So, if your commit object is not sent over the network Gerrit doesn't
see it.
There is a related issue already open:
http://code.google.com/p/gerrit/issues/detail?id=465
Changing Gerrit to process all the history between the pushed commit and
the current commit on the destination branch is a large change in
Gerrit's behavior that may never happen. It would make it somewhat
more consistent (the number of changes created/updated by a push will
dpened strictly of the history between the pushed commit and the
destination branch and not on random things such as some other,
unrelated branch, pointing to some of the SHA1s being pushed affecting
the number of commits transferred over the network and thus the list of
commits processed by Gerrit).
It would also plug a security hole (IMO) in the Gerrit review model, it's
possible right now to easly "sneak in" a reviewed branch code changes
and commit history without code review. First push all that history to
another branch (in the same repository) without code review and then make
an "innocent" commit on top of it that would pass review and send it for
review to the branch requiring reviews. The reviewers will look at the Gerrit
diff of that single commit without realizing that the parent commit is not the
current tip of the branch requiring review but some other SHA1 and once this
is approved and submitted the whole history and code changes brought in by
that parent become part of the history of the reviewed branch.
However, there are likely valid use cases that would be broken by this
change in behavior.
--
Mihai Rusu