The Gerrit system is only used by us several people. Once there is a Change A, and its status is: "Submitted, Merge Pending". The change list in the "open" web page. Also I noticed this Change had a dependency on another change B (which status is abandoned).
To do that, you click the “Submit” button in the Gerrit Web UI just as you would click the “Merge Pull Request” button in GitHub. Both, Gerrit and GitHub, allow different merge strategies, that can be enabled by project administrators.
Step 1 – Do the required modification in the code based on the review. Step 2 – Add files using git add commands. Step 3 – Command to update/amend the most recent commit. When amending a commit with git commit –amend, leave the Change-Id line unmodified in the commit message.
If change A has a dependency on B, then A cannot be merged until B is merged. Since you have abandoned B, Gerrit will not automatically merge A.
What you will need to do is modify A (perhaps using git rebase
) so that it no longer depends on B, and resubmit the change to Gerrit.
FYI. I had the same problem of "Submitted, Merge Pending" when user press submit twice on same page (she double clicked the submit button). It happened in Gerrit 2.11.
Error in log looks like
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '5173-2-1' for key 'PRIMARY'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
Before submitting there was only 1 commit (code changes). But after double pressing there are 2 commits. Second one is with new Commit Message and "Submitted, Merge Pending" status.
When I removed all information about second commit:
$ ssh -p 29418 admin@machine gerrit gsql
gerrit> delete from `patch_set_approvals` where change_id=5173 and patch_set_id=2;
gerrit> delete from `patch_set_ancestors` where change_id=5173 and patch_set_id=2;
gerrit> delete from `patch_sets` where change_id=5173 and patch_set_id=2;
it marked as integrated by user Gerrit Code Review .
What Greg states is correct, an automatic merge is not possible. It is possible to incorporate just A by using Gerrit's "cherry pick" option (essentially a manual merge). Unfortunately, this will not remove the "Merge Pending" status of Gerrit. I usually write a comment to this effect, if the Contributor cannot be troubled to rebase.
On Terminal:
where n is the commit count from top in list of commits generated on terminal from step 2
now merge your commit on Gerrit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With