| Issue 1072: | "Push Merge Commit" permission not working on refs/heads/* | |
| 105 people starred this issue and may be notified of changes. | Back to list |
Affected Version: 2.2.1 What steps will reproduce the problem? 1. Have an existing repository and codebase (which includes prior merges) 2. Create a new project in gerrit with no initial commit 3. Grant "Push Merge Commit" on the project for "refs/heads/*" 4. Try to push to populate the initial codebase: git push gerrit master What is the expected output? What do you see instead? Expected to successfully push (and create) the "master" branch. Instead: ! [remote rejected] master -> master (you are not allowed to upload merges) Please provide any additional information below. I tried several variations of permissions to fix this, and the only way I could get it to accept an initial populated codebase that contains merges was by adding "Push Merge Commit" on "refs/for/*". I expect the permission on "refs/for/*" to mean "I can push a merge commit to gerrit *for review*", and I expect "refs/heads/*" to mean "I can push a merge commit to the gerrit branch directly. Instead, it seems to require permission to create a review of the merge commit in order to populate the branch, and that seems counter-intuitive.
Aug 5, 2011
#1
dev...@gmail.com
Aug 5, 2011
@c1: but it does work with the permission assigned on refs/for/*? It's possible that the original intent of this permission was to place it on refs/*, but that seems strange to me. I may want to grant a user like Jenkins to be able to push a merge into a branch as a branch update, but there's no reason to even think to allow Jenkins to push to refs/for/* at all (unless I want to review Jenkins's change before merging it ;) I still think having the permission on refs/for/* should mean that a user is able to upload a merge for review; and on refs/heads/* means the user is able to update (fast-forward) the branch to contain the merge.
Aug 5, 2011
I tried granting "push merge commit" to refs/for/my-branch-name and the push was still rejected. I then tried granting it to refs/for/* and then the push was accepted.
Aug 5, 2011
@c3: Yeah, that's because it is actually looking for the permission on "refs/for/refs/heads/my-branch-name". Assigning it just to "refs/for/my-branch-name" will not have the effect you were looking for. That's why refs/for/* works in this case, because it matches refs/for/refs/heads/branch.
Nov 28, 2011
I try to create initial commit to gerrit from current project. I want to push refs/heads/master and already get rights for Push Merge Commit but I still receive master (you are not allowed to upload merges) error messge. Any quick fix or patch for this?
Nov 28, 2011
@c5: See the original description of the issue. You have to set the permission on "refs/for/refs/heads/master"... NOT just refs/heads/master.
Jan 31, 2012
This remains an issue in Gerrit 2.2.2, which I'm trying to set up now.
Jan 31, 2012
jfuerth, see comments 4 and 6. The only thing I don't understand is why this bug hasn't been closed as "not a bug".
Jan 31, 2012
Comments 4 and 6 appear to describe a workaround (which did work for me). I found nothing in the documentation (or anywhere else on the web) that says certain permissions on refs/for/refs/heads/* actually apply to pushes targeting refs/heads/*. I think it's still a bug--just one with a known workaround.
Jan 31, 2012
Ard... Because it *is* a bug. Comments 4 and 6 give a workaround, but comment 2 explains why it is a bug.
Feb 23, 2012
this is a bug, and there is NO known workaround: i want "some" developers to be able to push merges from other gerrit managed branches directly onto master (so no review). but when i configure it like described here, i can push both directly and through the review. guess how long it took until the first accidental push to gerrit instead of directly into the repo was made...? it was the first one... D: i have no chance to prevent people from pushing merges and creating faulty review items. also since this happened, gerrit injected false dependencies in existing reviews, and is sending massive loads of mails for the merged commits (which where in turn gerrit-created merge commits for the reviews on the other branch & project). something else is wrong here too.
Aug 28, 2012
When using refs/* , my push merge commit worked.
Sep 25, 2012
Exact same issue as described in bug description. Version of gerrit is 2.4.2. All settings (Push, Forge Committer Identity,...) work when specified on refs/heads/*, but Push Merge Commit doesn't. I understand the work around, though, any change this will be fixed?
Jan 18, 2013
i have the same problem on Gerrit 2.5 Temporary solution - Push Merge Commit to refs/*
May 2, 2013
I have the same problem on Gerrit 2.5.2. Temporary solution - Push Merge Commit to refs/*.
Sep 3, 2013
This also affects 2.6.1.
Sep 27, 2013
(No comment was entered for this change.)
Status:
Submitted
Labels: FixedIn-2.8
Oct 1, 2013
This change broke projects that allowed Push Merge Commit to refs/for/*.
I suppose we'll need to update existing ACLs to lop off the refs/for ("refs/for/*" becomes "refs/*", "refs/for/refs/heads/*" becomes "refs/heads/*") as part of the upgrade to keep existing installations working.
Oct 1, 2013
Reverted. (https://gerrit-review.googlesource.com/50380/)
Oct 2, 2013
(No comment was entered for this change.)
Status:
New
Labels: -FixedIn-2.8
May 20, 2014
So, guys, when do you plan to fix this issue? )
Jun 16, 2014
Hi, Any chances of this issue getting fixed in next gerrit release? :)
Jul 28, 2014
Hi, I tested on stable-2.9 with assigning PUSH permission to user and we are able to direct push merge commit using git push origin HEAD:refs/head/<branch>. Also I tested pushing direct commit using git push origin HEAD:refs/for/refs/head/<branch> and it worked too. So does this mean that issue is fixed in 2.9?
Jul 28, 2014
Correction: Also I tested pushing merge commit using git push origin HEAD:refs/for/refs/head/<branch> and it worked too.
Oct 15, 2015
Hi. if there is no problem I will use by lucky way
Dec 29, 2015
The fixing patch for this issue isn't merged? https://gerrit-review.googlesource.com/#/c/59021/
Dec 29, 2015
@28 No. Like the last comment from David for that change says, it has been abandoned as there was "No update since 8 months ago. Needs conflict resolution". |
|
| ► Sign in to add a comment |