Gerrit Change has Status:Submitted, Merge Pending, how to solve it?

孤者浪人 提交于 2019-12-03 18:01:28

问题


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).

  1. How to make A listed on "Merged" web page ?
  2. How to make B disappear, so A has no more dependency on B ?

回答1:


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.




回答2:


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 .




回答3:


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.




回答4:


Guy. If you commit has a tag, you may meet a bug. This bug had been fixed in Gerrit V2.7.

Bug reference: https://groups.google.com/forum/#!topic/repo-discuss/tLVMibfzroc




回答5:


I had the same problem of "Submitted, Merge Pending" without any dependency or conflict. Quick fix is to go through all open items and see if there is any other commit in "Submitted, Merge Pending" status. If yes, just abandon them all.

Then git commit --amend -m "your original comments" and git push again, this time you can have your fix merged.




回答6:


I faced this issue because I pushed a tag to branch name:

git tag x.y.z HEAD
git push -f origin x.y.z:master

So better push a branch instead,

git tag x.y.z HEAD
git push -f origin HEAD:master

That way gerrit is able to merge again my pending patches.




回答7:


  1. Abandon your push from Gerrit.

On Terminal:

  1. git log
  2. git reset HEAD~n

where n is the commit count from top in list of commits generated on terminal from step 2

  1. git add .
  2. git commit -m "Your message"
  3. git push

now merge your commit on Gerrit.



来源:https://stackoverflow.com/questions/8737326/gerrit-change-has-statussubmitted-merge-pending-how-to-solve-it

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!