Hey all,
Fundraising uses deploy branches -- and this is a question about how to manage them via gerrit / git-review. Effectively -- what am I doing wrong that causes gerrit to reject my changes as exampled below:
Take for example CentralNotice (I created a test branch mwalker_test that was cloned from far back in the repo). If I follow the basic example of how I cherry pick a change into core, e.g.:
git fetch git checkout mwalker_test git cherry-pick 491b0dbb3ac01b4ebe6288cc5ea7e9aff6d49753 <-- a change beyond my current tip git review
gerrit tells me:
$ git cherry-pick 491b0dbb3ac01b4ebe6288cc5ea7e9aff6d49753 [mwalker_test 7016450] Add dependency to mobile module Author: jrobson jrobson@wikimedia.org 1 file changed, 1 insertion(+) $ git review remote: Resolving deltas: 100% (2/2) remote: Processing changes: refs: 1, done To ssh:// mwalker@gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice.git ! [remote rejected] HEAD -> refs/publish/master/mwalker_test (change 59546 closed) error: failed to push some refs to 'ssh:// mwalker@gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice.git'
Say what!? The mystery further deepens when I do a straight up merge:
$git merge master ... $ git review remote: Processing changes: refs: 1, done To ssh:// mwalker@gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice.git ! [remote rejected] HEAD -> refs/publish/master/mwalker_test (no new changes) error: failed to push some refs to 'ssh:// mwalker@gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice.git'
Anyone have any ideas?
~Matt Walker Wikimedia Foundation Fundraising Technology Team
(The below is how I understand this. I am no gerrit expert, though, and I might be wrong.)
Note this part:
! [remote rejected] HEAD -> refs/publish/master/mwalker_test (change 59546 closed)
That's gerrit ("remote") telling you that the change is no good ("rejected"), because https://gerrit.wikimedia.org/r/#/c/59546/ ("change 59546") is already merged ("closed").
This means that instead of submitting the change to whatever branch you wanted to, you're actually submitting it to master.
You should either fix the .gitreview file to have something else than "defaultbranch=master" in it for your branch, or just use the good old `git push gerrit HEAD:refs/for/<branch>` command instead of `git review`.
(Or, if you did mean to submit this to master for some reason, remove the Change-Id line and have a new one generated to create a new gerrit changeset.)
Genius!
I swore I tried git push gerrit HEAD:refs/for/??? and it not working -- but clearly I had done something else boneheaded.
It was indeed the .gitreview file pointing to the wrong branch that was the cause of all my troubles.
Thanks :)
~Matt Walker Wikimedia Foundation Fundraising Technology Team
On Fri, May 17, 2013 at 2:55 AM, Bartosz Dziewoński matma.rex@gmail.comwrote:
(The below is how I understand this. I am no gerrit expert, though, and I might be wrong.)
Note this part:
! [remote rejected] HEAD -> refs/publish/master/mwalker_**test (change
59546 closed)
That's gerrit ("remote") telling you that the change is no good ("rejected"), because https://gerrit.wikimedia.org/**r/#/c/59546/https://gerrit.wikimedia.org/r/#/c/59546/("change 59546") is already merged ("closed").
This means that instead of submitting the change to whatever branch you wanted to, you're actually submitting it to master.
You should either fix the .gitreview file to have something else than "defaultbranch=master" in it for your branch, or just use the good old `git push gerrit HEAD:refs/for/<branch>` command instead of `git review`.
(Or, if you did mean to submit this to master for some reason, remove the Change-Id line and have a new one generated to create a new gerrit changeset.)
-- Matma Rex
______________________________**_________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/wikitech-lhttps://lists.wikimedia.org/mailman/listinfo/wikitech-l
And... as S reminded me -- this is now documented at our handy little debugging guide to gerrit:
https://www.mediawiki.org/wiki/Gerrit/Advanced_usage#.22.5Bremote_rejected.5...
~Matt Walker Wikimedia Foundation Fundraising Technology Team
On Fri, May 17, 2013 at 9:43 AM, Matthew Walker mwalker@wikimedia.orgwrote:
Genius!
I swore I tried git push gerrit HEAD:refs/for/??? and it not working -- but clearly I had done something else boneheaded.
It was indeed the .gitreview file pointing to the wrong branch that was the cause of all my troubles.
Thanks :)
~Matt Walker Wikimedia Foundation Fundraising Technology Team
On Fri, May 17, 2013 at 2:55 AM, Bartosz Dziewoński matma.rex@gmail.comwrote:
(The below is how I understand this. I am no gerrit expert, though, and I might be wrong.)
Note this part:
! [remote rejected] HEAD -> refs/publish/master/mwalker_**test (change
59546 closed)
That's gerrit ("remote") telling you that the change is no good ("rejected"), because https://gerrit.wikimedia.org/**r/#/c/59546/https://gerrit.wikimedia.org/r/#/c/59546/("change 59546") is already merged ("closed").
This means that instead of submitting the change to whatever branch you wanted to, you're actually submitting it to master.
You should either fix the .gitreview file to have something else than "defaultbranch=master" in it for your branch, or just use the good old `git push gerrit HEAD:refs/for/<branch>` command instead of `git review`.
(Or, if you did mean to submit this to master for some reason, remove the Change-Id line and have a new one generated to create a new gerrit changeset.)
-- Matma Rex
______________________________**_________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/wikitech-lhttps://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org