Jonathan Nieder [off-list ref] writes:
There is one trick a server can use to mitigate this: advertise some
refs that don't exist! If you advertise a ref ".have", then Git
will understand that the server has that object but it is not an
actual ref. Gerrit uses this trick in its HackPushNegotiateHook[1]
to advertise a few recent commits.
...
Summary: (1) try fetching first (2) let's improve
HackPushNegotiateHook#advertiseRefs (3) let's improve "git push"
protocol to make this a problem of the past.
In the meantime, perhaps we can teach receive-pack the same "let's
advertise a few recent commits as if they exist as tips of refs" as
well?