Create branch permission bug?

44 views
Skip to first unread message

Eric Tsai

unread,
Apr 11, 2018, 12:37:45 PM4/11/18
to Repo and Gerrit Discussion
I'm now using Gerrit 2.14.7.

With "Create Reference" permission for "refs/heads/*", users can create branch from any existing commit on Gerrit UI or "gerrit create-branch" command.
But when creating branch "git push origin HEAD:refs/heads/NEW_BRANCH_NAME", I see message like:

remote: ERROR:  In commit b9120288f2036ab5590049f1d16de5d87ad8a0f5
remote: ERROR:  committer email address android-buil...@google.com
remote: ERROR:  does not match your user account.
remote: ERROR:
remote: ERROR:  The following addresses are currently registered:
remote: ERROR:    us...@domain.com
remote: ERROR:
remote: ERROR:  To register an email address, please visit:

HEAD is a commit which already exists in remote.
So I need to assign additional "Forge Committer Identity" permission in order to create branch by git push.

Since required permissions for creating new branch in different ways are different, I think this is a bug.

I remembered that in Gerrit 2.13.11, there's no such issue.

Gert van Dijk

unread,
Apr 11, 2018, 5:39:29 PM4/11/18
to Repo and Gerrit Discussion
Based on my experience with creation of tags, I think this all depends on whether or not you push new content. Suppose there's already a branch called master, and you push the same tip to to NEW_BRANCH_NAME, this is allowed whether or not you have the forge author/committer permissions. If your local HEAD that you push contains new content, Gerrit will validate the permissions over the commits that you actually push.

Matthias Sohn

unread,
Apr 11, 2018, 5:41:54 PM4/11/18
to Eric Tsai, Repo and Gerrit Discussion
On Wed, Apr 11, 2018 at 6:37 PM, Eric Tsai <erict...@gmail.com> wrote:
I'm now using Gerrit 2.14.7.

With "Create Reference" permission for "refs/heads/*", users can create branch from any existing commit on Gerrit UI or "gerrit create-branch" command.
But when creating branch "git push origin HEAD:refs/heads/NEW_BRANCH_NAME", I see message like:

remote: ERROR:  In commit b9120288f2036ab5590049f1d16de5d87ad8a0f5
remote: ERROR:  committer email address android-build-team-robot@google.com
remote: ERROR:  does not match your user account.
remote: ERROR:
remote: ERROR:  The following addresses are currently registered:
remote: ERROR:    us...@domain.com
remote: ERROR:
remote: ERROR:  To register an email address, please visit:

HEAD is a commit which already exists in remote.
So I need to assign additional "Forge Committer Identity" permission in order to create branch by git push.

Since required permissions for creating new branch in different ways are different, I think this is a bug.

I remembered that in Gerrit 2.13.11, there's no such issue.

you need Forge Committer Identity if you are pushing a commit which has committer identity not matching
the authenticated user pushing the commit
Reply all
Reply to author
Forward
0 new messages