Affected Version: 2.1.8, 2.2.2-rc1
Steps to reproduce the problem:
1. Create a commit with Change-Id A
2. Create a second commit with the same Change-Id A
3. Try to push both changes to Gerrit
You'll get the following error message
! [remote rejected] HEAD -> refs/for/master (squash commits first)
This message is
a) misleading - my first interpretation of it was that it is not possible to push multiple changes at once (and this even though I vaguely remembered having done this before; I had assumed that this was some configuration option I had not heard about before).
b) possibly incorrect - the root of the problem was the rare case according to [1], i.e. I had given the same Change-Id to two distinct commits. So the solution was to fix the Change-Id in one of them, and not to squash them together.
I'd propose to issue a different message, e.g. something like "cannot push commit which depends on a commit with the same Change-Id". Sure this is complicated, but so is the error case. Hopefully this will either point people in the right direction, or if they don't understand the message, encourage them to read the (good) documentation.
[1] https://git.wdf.sap.corp:8080/Documentation/error-squash-commits-first.html