Issue 883: Push of 2 commits: push of successor commit succeeds although push of predecessor commit fails -> result: unsatisfiable dependency on submit
Status:  Accepted
Owner: ----
Project Member Reported by edwin.ke...@gmail.com, Mar 17, 2011
Affected Version: 2.1.6.1

What steps will reproduce the problem?
1. create a commit A with Change-ID X and push it to Gerrit
2. create a successor commit B which has the same Change-ID X
3. pushing commit B fails as expected with "squash commits first" [1]
4. submit the change for commit A in Gerrit
5. create a commit C which is successor of commit B
6. push commit C to Gerrit (this includes pushing of commit B)
7. the push of commit C succeeds and a new change in Gerrit is created while at the same time the push of commit B still fails with "squash commits first"
"$ git push ssh://me@localhost:29418/myProject HEAD:refs/for/master
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (8/8), 775 bytes, done.
Total 8 (delta 0), reused 0 (delta 0)
remote:
remote: New Changes:
remote:   http://127.0.0.1:8888/600
remote:
To ssh://me@localhost:29418/myProject
 ! [remote rejected] HEAD -> refs/for/master (squash commits first)
error: failed to push some refs to 'ssh://me@localhost:29418/myProject'"
8. try to submit the change for commit C in Gerrit and see that it fails with:
"Change cannot be merged due to unsatisfiable dependencies." (which is correct since there is no change for commit B)

What is the expected output? What do you see instead?
It is expected that the push described in step 7 is failing completely and that no change is created for commit C. If several commits are pushed at once either all commits should be pushed successfully or none of the commits should be pushed. Especially it makes no sense to create a change for a commit if the predecessor commit could not be pushed.

Please provide any additional information below.

[1] https://android.git.kernel.org/?p=tools/gerrit.git;a=blob_plain;f=Documentation/error-squash-commits-first.txt;hb=refs/heads/master

Mar 17, 2011
Project Member #1 edwin.ke...@gmail.com
sorry, please skip step 4. to reproduce the problem
Mar 18, 2011
Project Member #2 edwin.ke...@gmail.com
Here is another way to produce a similar error.

What steps will reproduce the problem?
1. create a commit A and push it to Gerrit, let's say this creates change 711
2. reset the local branch to HEAD~1
3. create a commit B and a successor commit C
4. push HEAD:refs/changes/711
5. the push succeeds without any error messages
6. as result commit C becomes a new patch set for change 711, but there is no change for commit B
7. submiting change 711 fails with "Change cannot be merged due to unsatisfiable dependencies." because it depends on commit B for which no change exists

What is the expected output? What do you see instead?
It is expected that the push in step 4 fails and change 711 is not updated.
May 20, 2011
Project Member #3 nas...@grainawi.org
(No comment was entered for this change.)
Status: Accepted
Apr 18, 2012
#4 tobias.o...@sap.com
When I stubled over the problem, I executed the steps (as described above) in a slightly different order: I first created the three commits A, B, C, and then tried to push them Gerrit. This failed as expected. Then I tried to push them one by one wich succeeded for A, failed for B (but https swallowed the message), and succeeded for C (which is the described bug).