Pushing full repo to gerrit

619 views
Skip to first unread message

syntax error

unread,
Apr 3, 2011, 2:09:18 PM4/3/11
to Repo and Gerrit Discussion
Hi all,

Someone could explain me how to create a repo to push into gerrit? I
have been searching around on google but can not get any information
regarding creating a mirror repo and pushing that to my gerrit system.
What I am after is to be using my own full Gingerbread or Froyo branch
that is linked in gerrit.

If anyone could explain it me with a few steps please.

Thanks in advance,

Magnus Bäck

unread,
Apr 4, 2011, 1:40:45 AM4/4/11
to Repo and Gerrit Discussion
On Sunday, April 03, 2011 at 20:09 CEST,
syntax error <impor...@gmail.com> wrote:

> Someone could explain me how to create a repo to push into gerrit? I
> have been searching around on google but can not get any information
> regarding creating a mirror repo and pushing that to my gerrit system.
> What I am after is to be using my own full Gingerbread or Froyo branch
> that is linked in gerrit.

If you're asking what I think you're asking this was discussed just a
few days ago.

http://groups.google.com/group/repo-discuss/browse_frm/thread/a970482df8d5574e

If this wasn't what you were looking for please come back with a more
specific question.

--
Magnus B�ck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Mali Laurent

unread,
Apr 4, 2011, 3:21:03 AM4/4/11
to Repo and Gerrit Discussion
Hi Magnus,

Yes I noticed that after writing this email. So sorry about that. That thread helps a lot :)
Although how would I do this to integrate the created repo mirror into gerrit?

Do I create a new manifest.git project and push that to gerrit -> manifest.git?
Do I need to create a new git project in gerrit for every git project in my local repo mirrir?
Is there any way to push it all at the same time into gerrit without creating every single git as a new project?

Thanks in advance,


On Mon, Apr 4, 2011 at 7:40 AM, Magnus Bäck <magnu...@sonyericsson.com> wrote:
On Sunday, April 03, 2011 at 20:09 CEST,
    syntax error <impor...@gmail.com> wrote:

> Someone could explain me how to create a repo to push into gerrit? I
> have been searching around on google but can not get any information
> regarding creating a mirror repo and pushing that to my gerrit system.
> What I am after is to be using my own full Gingerbread or Froyo branch
> that is linked in gerrit.

If you're asking what I think you're asking this was discussed just a
few days ago.

http://groups.google.com/group/repo-discuss/browse_frm/thread/a970482df8d5574e

If this wasn't what you were looking for please come back with a more
specific question.

--
Magnus Bäck                   Opinions are my own and do not necessarily

SW Configuration Manager      represent the ones of my employer, etc.
Sony Ericsson

Magnus Bäck

unread,
Apr 4, 2011, 3:45:48 AM4/4/11
to Repo and Gerrit Discussion
On Monday, April 04, 2011 at 09:21 CEST,
Mali Laurent <impor...@gmail.com> wrote:

> Yes I noticed that after writing this email. So sorry about that. That
> thread helps a lot :)
> Although how would I do this to integrate the created repo mirror into
> gerrit?
>
> Do I create a new manifest.git project and push that to gerrit ->
> manifest.git?
> Do I need to create a new git project in gerrit for every git project
> in my local repo mirrir?
> Is there any way to push it all at the same time into gerrit without
> creating every single git as a new project?

You can't push a git into the void -- the git must exist on the server
side. Gerrit's SSH-accessible command-line interface contains a command
for creating projects so this shouldn't be a problem. Connect this to
the ls-projects command run against android.git.kernel.org and you'll
have your projects set up in no time.

Syntax Error

unread,
Apr 4, 2011, 9:12:04 AM4/4/11
to Repo and Gerrit Discussion
Thanks for the prompt answer. 

so I have manually created all the gits on the server with the gerrit create-project command. It now is the same as androids setup.
What about:

   repo forall -c 'git push ssh://yourserver.example.com/$REPO_PROJECT
       "refs/heads/*:refs/heads/aosp/*"' 

How do I create this $REPO_PROJECT?


Magnus Bäck

unread,
Apr 4, 2011, 10:11:30 AM4/4/11
to Repo and Gerrit Discussion
On Monday, April 04, 2011 at 15:12 CEST,
Syntax Error <impor...@gmail.com> wrote:

> so I have manually created all the gits on the server with the gerrit
> create-project command. It now is the same as androids setup.
> What about:
>
> repo forall -c 'git push ssh://yourserver.example.com/$REPO_PROJECT \
> "refs/heads/*:refs/heads/aosp/*"'
>
> How do I create this $REPO_PROJECT?

That environment variable is set by "repo forall" -- or what do
you mean? See "repo help forall". Before allowing commands like
this run all over the place, prepend the command with echo to
show what would be run. If this looks okay, remove the echo to
actually run the commands. I've seen disasters happen when people
don't do this and e.g. end up creating hundreds or even thousands
of branches in hundreds of gits.

Syntax Error

unread,
Apr 5, 2011, 7:44:45 AM4/5/11
to Repo and Gerrit Discussion
Hi,

I created the mirror. Created the git projects manually and did a:
repo forall -c 'git push ssh://gerrithost/$REPO_PROJECT HEAD:refs/heads/master' 
This seems to have pushed everything into my git/gerrit system. Although I can not see any update information in gerrit at the time but I guess this is normal as I am not doing a commit.

When executing:
repo init -u ssh://gerrithost/android.git -b gingerbread

I get:
From ssh://gerrithost/android
 * [new branch]      aosp/eclair -> origin/aosp/eclair
 * [new branch]      aosp/froyo -> origin/aosp/froyo
 * [new branch]      aosp/froyo-stable -> origin/aosp/froyo-stable
 * [new branch]      aosp/gingerbread -> origin/aosp/gingerbread
 * [new branch]      aosp/master -> origin/aosp/master
 * [new branch]      aosp/themes-exp -> origin/aosp/themes-exp
 * [new branch]      master     -> origin/master
error: revision gingerbread in manifests not found

so when I execute:
repo init -u ssh://gerrithost/android.git -b aosp/gingerbread

It is still repo syncing from a remote repository...



Magnus Bäck

unread,
Apr 5, 2011, 3:53:48 PM4/5/11
to Repo and Gerrit Discussion
On Tuesday, April 05, 2011 at 13:44 CEST,
Syntax Error <impor...@gmail.com> wrote:

> I created the mirror. Created the git projects manually and did a:
> repo forall -c 'git push ssh://gerrithost/$REPO_PROJECT
> HEAD:refs/heads/master'
> This seems to have pushed everything into my git/gerrit system.
> Although I can not see any update information in gerrit at the
> time but I guess this is normal as I am not doing a commit.

Correct, commits pushed straight to refs/heads/whatever won't show up
in Gerrit.

> When executing:
> repo init -u ssh://gerrithost/android.git -b gingerbread
>
> I get:
> From ssh://gerrithost/android
> * [new branch] aosp/eclair -> origin/aosp/eclair
> * [new branch] aosp/froyo -> origin/aosp/froyo
> * [new branch] aosp/froyo-stable -> origin/aosp/froyo-stable
> * [new branch] aosp/gingerbread -> origin/aosp/gingerbread
> * [new branch] aosp/master -> origin/aosp/master
> * [new branch] aosp/themes-exp -> origin/aosp/themes-exp
> * [new branch] master -> origin/master
> error: revision gingerbread in manifests not found

Right, because there is no manifest branch named gingerbread.

> so when I execute:
> repo init -u ssh://gerrithost/android.git -b aosp/gingerbread
>
> It is still repo syncing from a remote repository...

Yes, because default.xml on the aosp/gingerbread branch still references
android.git.kernel.org. Branch aosp/gingerbread and adjust the server
hostname. You also need to make sure that the manifest points to the
desired version for each git. Either change the default revision from
gingerbread to aosp/gingerbread or create a gingerbread branch in each
git. If you want to have a manifest that your users can make
modifications to you must create a gingerbread branch (you don't have
to call it gingerbread of course but it probably makes sense). Make sure
you do not allow people to make changes to the aosp/* branches.

(Note that some gits don't use the gingerbread branch but rather
tools_r8 or similar. Whatever you do for the majority of the gits you
also need to do there.)

Syntax Error

unread,
Apr 17, 2011, 3:22:06 AM4/17/11
to Repo and Gerrit Discussion
Hi Group,

I finally got it all working the way I wanted it. It was easier as I thought. But without the input from you guys it would have taken probably a lot longer. So thanks for that.
My only question about branches, I had to create the gingerbread branches into gerrit as or else it would not really pull as the manifest was complaining about it. I just do not understand why gerrit is not showing the changes I make and push to the underlaying branches?

These are my branches in gerrit:

HEAD master
gingerbread a4f98fcbefe8acb0fee248bd4ad955528efae08c


master 64a8ee1b03c5004fc407b6fdc907cea8e67a2f2e

When I push updates to: git push ssh://gerrithost/ProjectName.git HEAD:refs/for/master It does show correctly.
But when pusing into: git push ssh://gerrithost/ProjectName.git HEAD:refs/for/gingerbread it does not show anything in gerrit?


Magnus Bäck

unread,
Apr 17, 2011, 5:02:56 AM4/17/11
to Repo and Gerrit Discussion
On Sunday, April 17, 2011 at 09:22 CEST,
Syntax Error <impor...@gmail.com> wrote:

> My only question about branches, I had to create the gingerbread
> branches into gerrit as or else it would not really pull as the
> manifest was complaining about it. I just do not understand why gerrit
> is not showing the changes I make and push to the underlaying
> branches?
>
> These are my branches in gerrit:
>
> HEADmastergingerbreada4f98fcbefe8acb0fee248bd4ad955528efae08c
>
> master64a8ee1b03c5004fc407b6fdc907cea8e67a2f2e

Right, and these branches were originally created based on
aosp/gingerbread and aosp/master (or whatever you choose to
call the upstream branches)?

> When I push updates to: git push ssh://gerrithost/ProjectName.git
> HEAD:refs/for/master It does show correctly.
> But when pusing into: git push ssh://gerrithost/ProjectName.git
> HEAD:refs/for/gingerbread it does not show anything in gerrit?

Is a change actually created? What's the output of "repo upload"?

Syntax Error

unread,
Apr 17, 2011, 5:16:58 AM4/17/11
to Repo and Gerrit Discussion
On Sun, Apr 17, 2011 at 11:02 AM, Magnus Bäck <magnu...@sonyericsson.com> wrote:
On Sunday, April 17, 2011 at 09:22 CEST,
    Syntax Error <impor...@gmail.com> wrote:

> My only question about branches, I had to create the gingerbread
> branches into gerrit as or else it would not really pull as the
> manifest was complaining about it. I just do not understand why gerrit
> is not showing the changes I make and push to the underlaying
> branches?
>
> These are my branches in gerrit:
>
> HEADmastergingerbreada4f98fcbefe8acb0fee248bd4ad955528efae08c
>
> master64a8ee1b03c5004fc407b6fdc907cea8e67a2f2e

Right, and these branches were originally created based on
aosp/gingerbread and aosp/master (or whatever you choose to
call the upstream branches)?

No, what I did was remove .git from the repositories I am working on. These will be not needed to sync from AOSP but only from our server.
Did a git init, commit, created it on the gerrit server and added them to the correct default.xml to pull only from our server.
So to answer, I created a master branch for it and with gerrit project admin added a gingerbread branch on the GUI. So that doing a -b gingerbread it will pull out correctly.
 

> When I push updates to: git push ssh://gerrithost/ProjectName.git
> HEAD:refs/for/master It does show correctly.
> But when pusing into: git push ssh://gerrithost/ProjectName.git
> HEAD:refs/for/gingerbread it does not show anything in gerrit?

Is a change actually created? What's the output of "repo upload"?


I am not using repo upload to update changes. but rather git push ssh://gerrithost/ProjectName.git HEAD:refs/for/gingerbread (for every project I have)
 
--
Magnus Bäck                   Opinions are my own and do not necessarily
SW Configuration Manager      represent the ones of my employer, etc.
Sony Ericsson

Magnus Bäck

unread,
Apr 17, 2011, 5:24:43 AM4/17/11
to Repo and Gerrit Discussion
On Sunday, April 17, 2011 at 11:16 CEST,
Syntax Error <impor...@gmail.com> wrote:

> On Sun, Apr 17, 2011 at 11:02 AM, Magnus Bäck
> <magnu...@sonyericsson.com>wrote:
>
> > On Sunday, April 17, 2011 at 09:22 CEST,
> > Syntax Error <impor...@gmail.com> wrote:

[...]

> > > When I push updates to: git push ssh://gerrithost/ProjectName.git
> > > HEAD:refs/for/master It does show correctly.
> > > But when pusing into: git push ssh://gerrithost/ProjectName.git
> > > HEAD:refs/for/gingerbread it does not show anything in gerrit?
> >
> > Is a change actually created? What's the output of "repo upload"?
>
> I am not using repo upload to update changes. but rather git push
> ssh://gerrithost/ProjectName.git HEAD:refs/for/gingerbread (for every
> project I have)

Okay, but what's the output of *that* command then?

Reply all
Reply to author
Forward
0 new messages