Jump to content

Topic on Talk:Gerrit/Advanced usage

! [remote rejected] master -> master (prohibited by Gerrit)

6
Benedikt Kämpgen (talkcontribs)

Hi, Sorry, but MW-Git and Gerrit are driving me crazy.

I wanted to push a patch into my own project "Semantic Web Browser" , but now I get the error:

benedikt@benedikt-ThinkPad-T410:~/Workspaces/Git-Repositories/SemanticWebBrowser$ git push 
Counting objects: 15, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 1.24 KiB, done.
Total 8 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4)
remote: Branch refs/heads/master:
remote: You are not allowed to perform this operation.
remote: To push into this reference you need 'Push' rights.
remote: User: bkaempgen
remote: Please read the documentation and contact an administrator
remote: if you feel the configuration is incorrect
remote: Processing changes: refs: 1, done    
To ssh://bkaempgen@gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticWebBrowser.git
 ! [remote rejected] master -> master (prohibited by Gerrit)
error: failed to push some refs to 'ssh://bkaempgen@gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticWebBrowser.git'

Is it because someone (assumably a bot) created a branch in the project?

                Branch Name	Revision	
		HEAD	master	(gitblit)
		refs/meta/config	ad3f8c4f42a89287a45a796f4133c6787d579050	(gitblit)
		REL1_21	de4a45be3fb2c14b01c679c3ed006b77bcca254f	(gitblit)
		master	53c8a0ddabaf94fb72efce76167eba7cca71defb	(gitblit)

What do I need to do to be able to push, again?

Nemo bis (talkcontribs)

Why is there the name gitblit in there? Are you sure you cloned from gerrit?

Benedikt Kämpgen (talkcontribs)

Hi Nemo,

Thanks for your answer.

Yes, I am pretty sure, I tried:

I now installed git review and were finally able to do "git review -R master", but now I have to review my own code in gerrit.

Is the MediaWiki repository still assumed to be used by ordinary extension developers? It has become quite complicated to manage your own extensions and I am not a noobie.

Best,

Benedikt

Benedikt Kämpgen (talkcontribs)

In other words, how can I do fast-forward or more easily push my changes?

I might need to stop using the repository, otherwise, since I just do not have the time to fiddle around with the system.

Krinkle (talkcontribs)

As it says in the error message (granted, the output is cluttered, this is an issue in Gerrit):

remote: You are not allowed to perform this operation.
remote: To push into this reference you need 'Push' rights.

Depending on how this particular repository is configured you are not supposed to push to the git repo directly. Instead you push for review to Gerrit and there Jenkins can run any lint/unit tests and perhaps code review and then it can be merged into the repository from the Gerrit interface (a bit like GitHub, except that everything is required to go via a pull-request, even if you end up merging it yourself).

If you are the owner of this repository you can request the right to push directly, thus bypassing Gerrit. Note though that you should not do this if you use Gerrit to process patches from other contributors since it'll be confusing if the Gerrit log doesn't show all commits. You can still merge your own commits if you so desire, just use git review (instead of git push) to submit to Gerrit and from there you can process them.

Benedikt Kämpgen (talkcontribs)

Dear Krinkle,

Thanks for the information. Nemo also helped me to review some patch. Apparently, I now can do fast-forward, I have just successfully pushed a new version of Semantic Web Browser to Git.

Best,

Benedikt