$ cd /home/git # this is the path where our Gerrit instance keeps its git repositories$ repo init --mirror -b release -m $TAG \-u git://codeaurora.org/platform/manifest.git \--repo-url=git://codeaurora.org/tools/repo.git$ repo sync -j8
$ gerrit.sh restart$ ssh -p 29418 myserver gerrit ls-projects
$ mkdir ~/CAF$ cd ~/CAF$ repo init -b release -m $TAG \-u git://codeaurora.org/platform/manifest.git \--repo-url=git://codeaurora.org/tools/repo.git$ vi .repo/manifest.xml$ cd .repo/manifests$ git diff...<manifest>- <remote fetch="git://codeaurora.org/" name="caf" review="codeaurora.org"/>+ <remote fetch="ssh://myserver:29418/" name="caf" review="http://myserver:8080/"/>...$ git commit -a -m "Point to local server."$ cd ~/CAF$ repo sync -j8$ repo statusnothing to commit (working directory clean)
$ repo start test001 --all$ repo checkout test001$ repo status# on branch test001nothing to commit (working directory clean)$ cd kernel$ echo "TEST LINE\n" >> README$ git commit -a -m "added test line"$ git remote -vcaf ssh://myserver:29418/kernel/msm.git (fetch)caf ssh://myserver:29418/kernel/msm.git (push)$ git push caf test001...To ssh://myserver:29418/kernel/msm.git! [remote rejected] test001 -> test001 (prohibited by Gerrit)error: failed to push some refs to 'ssh://myserver:29418/kernel/msm.git'$ git push caf HEAD:refs/heads/test001...To ssh://myserver:29418/kernel/msm.git! [remote rejected] HEAD -> test001 (prohibited by Gerrit)error: failed to push some refs to 'ssh://mysever:29418/kernel/msm.git'$ git push caf test001 HEAD:refs/for/test001...To ssh://myserver:29418/kernel/msm.git! [remote rejected] HEAD -> refs/for/test001 (branch test001 not found)error: failed to push some refs to 'ssh://myserver:29418/kernel/msm.git'
$ repo --trace upload: unpickle /home/pdanse/CAF/.repo/manifests.git/config: unpickle /home/pdanse/.gitconfig: load refs /home/pdanse/CAF/.repo/projects/abi/cpp.git: unpickle /home/pdanse/CAF/.repo/projects/abi/cpp.git/config: export GIT_DIR=/home/pdanse/CAF/.repo/projects/abi/cpp.git: git rev-list --abbrev=8 --abbrev-commit --pretty=oneline --reverse --date-order ^eb789ea833d8d800662b67914d9c1785a58c2caa refs/heads/test001 -- 1>| 2>|: load refs /home/pdanse/CAF/.repo/projects/bionic.git: unpickle /home/pdanse/CAF/.repo/projects/bionic.git/config......: export GIT_DIR=/home/pdanse/CAF/.repo/projects/kernel.git: git log --pretty=format:%cd -n 1 refs/heads/test001 -- 1>| 2>|Upload project kernel/:branch test001 ( 1 commit, Tue Feb 25 04:01:26 2014 +0000):546734e9 added test lineto http://myserver:8080/ (y/n)? y: cd /home/pdanse/CAF/kernel: git update-index -q --unmerged --ignore-missing --refresh 1>| 2>|: git diff-index -z --cached HEAD 1>| 2>|: git diff-files -z 1>| 2>|: git ls-files -z --others --exclude-standard 1>| 2>|: git var GIT_COMMITTER_IDENT 1>| 2>|: git push --receive-pack=gerrit receive-pack ssh://pdanse@myserver:29418/kernel/msm refs/heads/test001:refs/for/3d4a060263030250b8a768e2ac6ad783cefbc6b1Counting objects: 5, done.Delta compression using up to 12 threads.Compressing objects: 100% (3/3), done.Writing objects: 100% (3/3), 338 bytes, done.Total 3 (delta 2), reused 0 (delta 0)remote: Resolving deltas: 100% (2/2)remote: Processing changes: refs: 1, doneTo ssh://pdanse@myserver:29418/kernel/msm! [remote rejected] test001 -> refs/for/3d4a060263030250b8a768e2ac6ad783cefbc6b1 (branch 3d4a060263030250b8a768e2ac6ad783cefbc6b1 not found)error: failed to push some refs to 'ssh://pdanse@myserver:29418/kernel/msm'----------------------------------------------------------------------[FAILED] kernel/ test001 (Upload failed)
Your manifest has projects whose revision is set to a sha1 rather than a branch.
When you do 'repo upload' it pushes to 'refs/for/branch' where 'branch' is the revision of the project in the manifest.
Your manifest has projects whose revision is set to a sha1 rather than a branch.
When you do 'repo upload' it pushes to 'refs/for/branch' where 'branch' is the revision of the project in the manifest.
On Tuesday, February 25, 2014 at 08:39 EST,
Paul Danset <paul....@gmail.com> wrote:
> In order to address the "prohibited by Gerrit" error, I've given
> myself various permissions (e.g. "Push", "Push Merge Commit", "Push
> Annotated Tag", etc) on various references (e.g. "refs/heads/*",
> "refs/for/*", "refs/*") without success. Unfortunately neither the
> Gerrit logs nor the git trace (via "export GIT_TRACE=2") have revealed
> what permissions are needed.
Did you grant the Create Reference permission?
> And since "git push ..." doesn't work, it's no surprise "repo upload"
> doesn't work either:
>
> $ *repo --trace upload*
[...]
> To ssh://pdanse@myserver:29418/kernel/msm
> ! [remote rejected] test001 ->
> refs/for/3d4a060263030250b8a768e2ac6ad783cefbc6b1 (branch
> 3d4a060263030250b8a768e2ac6ad783cefbc6b1 not found)
> error: failed to push some refs to 'ssh://pdanse@myserver:29418/kernel/msm'
>
> ----------------------------------------------------------------------
> [FAILED] kernel/ test001 (Upload failed)
While unsurprising, this is a different and unrelated problem. The
manifest's revision attribute for this project specifies a SHA-1 instead
of a branch. That attribute it used to decide the push destination for
uploads, so if you want 'repo upload' to push to the test001 branch
that's what you have to list in your manifest.