development by using repo

303 views
Skip to first unread message

Kevin Wang

unread,
Dec 12, 2008, 7:37:41 AM12/12/08
to repo-d...@googlegroups.com
Hi,

I have a question about repo usage, here is my scenario:

a group developers do the development, we need to review our patches before pushed to AOSP, that means we will keep some pending patches in our local repo.
I have tried to setup a repo mirror on the server, but seems doesn't work, after we do 'repo sync' on the server, our changes on the manifest will be lost.
at the same time, all our changes will be uploaded to the local server, but how to upload the patches only which those passed review? actually we need some patches keep on our local server so that everyone can build on our hardwares.

how to solve this issue?

below is the understanding to the repo mirror, is that correct?

on the server:
    sync with AOSP periodly, review and accept the patches, and upload periodly.
on individual's:
    sync with repo on the local server, and upload the change to local server.

Thanks
Kevin

Jey Michael

unread,
Dec 12, 2008, 3:22:18 PM12/12/08
to repo-d...@googlegroups.com
On Fri, Dec 12, 2008 at 4:37 AM, Kevin Wang <xuepu...@gmail.com> wrote:

> below is the understanding to the repo mirror, is that correct?
>
> on the server:
> sync with AOSP periodly, review and accept the patches, and upload
> periodly.
> on individual's:
> sync with repo on the local server, and upload the change to local
> server.

I am trying to have almost similar setup.

Step1)
I have a local mirror (vanilla repo init, repo sync) that I dont plan
to touch/edit except syncing.

Step2)
I make another MasterRepo mirrored from above local mirror by
a) repo init -u localIntranetPath --repo-url localIntranetUrl --mirror
b) Edit the manifest.xml to point to the local mirror
c) repo sync
d) Add another myCompanyManifest.xml parallel to default.xml, and
commit/push to the MasterRepo. (I add this new manifest in default
branch, because I have not figured out how to have it in the master
itself)

Step3)
Create clones for developers with the following

repo init -u use...@aa.bb.cc.dd:/home/MasterRepo/pandroid/manifest.git
--repo-url=use...@aa.bb.cc.dd:/home/MasterRepo/pandroid/repo.git -b
default -m MyCompanyManifest.xml

Now, the manifest.xml symlink points to my own version, for our local
developers.

This is experimental and I am putting it out here for others feedback
(Shawn? ) This seems to be the way to go, at this point. I can
probably remove the local-mirror and do everything with MasterRepo (as
you do), but I am avoiding extensive dealing with branches with repo
script, at this stage.

After Step2-c, if I do a sync in MasterRepo I am not losing my
manifest changes. I think its because I am doing something wrong.
Anyway, I think the local MasterRepo maintainer have to maintain this
modified manifest.xml.


A discussion on this crucial topic would help a lot of us, I think.
-Jey

kanagesh radhakrishnan

unread,
Dec 17, 2008, 4:38:11 AM12/17/08
to repo-d...@googlegroups.com

Hello Jey and others,

I have been trying to setup something similar too for sometime now.
Thanks to comments and suggestions from Shawn, I have been able to get
it up and working to an extent where I am testing stuff by cloning
from the local server. I am having some issues pushing changes back
to the repo on my local server from the development systems. Once
this is fixed, I plan to put the details into a small document so that
it's of help to others.

Meanwhile, I have a list of steps that I followed to set this up.

I have described the scenario of my requirement as follows. It should
ensure that we are on the same page before we get into the details.

I have multiple developers on my local network and I need to have all
the changes made by them under version control. I don't want each
developer to be syncing from the Android GIT repository hosted at
http://android.git.kernel.org/., but at the same time, I need all of
them to be in sync with the changes introduced in the Android sources
hosted at http://android.git.kernel.org/.

On my network I have the following:

One local server (say, 192.168.10.1) that will provide my version
control using GIT. The repositories are mirrored from
http://android.git.kernel.org/ and another site specific to an ARM
architecture which has added some other changes under vendor of the
android tree.

Developer systems that will do 'repo init' and 'repo sync' from this
local server (192.168.10.1), make changes or addition and commit the
changes to the local server (192.168.10.1).

When there are additions/changes made to Android sources hosted at
http://android.git.kernel.org, I will do a repo sync on the local
server (192.168.10.1) to fetch these changes. In case of any
conflicts, I need to resolve them and commit them the changes to the
local server. Once completed, the developers will do a 'repo sync' on
they host systems which will pull in the new changes from the local
server.

At any point of time, the developer's manifest file will only point to
the local server (192.168.10.1).

The local server has two manifest files - one that it hosts for the
developers - under platform/manifest.git - and another that it obtains
when it did a repo init for the first time)

The following steps illustrate how I set this up.

### Mirror and publish the Android sources on the local server #####
The following commands are run on the Local Server (192.168.10.1)

$ whoami
kanagesh

$ cd /home/git
(There is no user called 'git'. /home/git is a folder from where all
the git repositories are published. It belongs to the user, say,
kanagesh, with read, write, execute permissions for 'kanagesh')

$ ls -l /home/
drwxrwxr-x 12 root git-users 4096 2008-12-11 12:02 git

$ ls -l /home/git/
drwxrwxr-x 6 kanagesh git-users 4096 2008-12-10 10:15 test-repo

Developers who need to access the GIT repositories are part of a group
called 'git-users'.

$ mkdir android
$ cd android
$ repo init -u git://android.git.kernel.org/platform/manifest.git --mirror

$ ls -al
drwxrwxr-x 5 kanagesh kanagesh 4096 2008-12-10 09:40 .repo

$ repo sync
This will take some time.......

On successful completion
$ ls -l /home/git/android
drwxrwxr-x 3 kanagesh kanagesh 4096 2008-12-10 10:15 kernel
drwxrwxr-x 16 kanagesh kanagesh 4096 2008-12-10 14:08 platform
drwxrwxr-x 8 kanagesh kanagesh 4096 2008-12-11 10:56 repo.git

The local server has already been setup as a GIT server. The contents
of folder 'kernel' and all folders under 'platform' are published on
the local server.

######### Setup the Manifest file on the local server published for
the developers ###########
The following commands are run on the Local Server (192.168.10.1)

Clone the manifest.git tree
$ git-clone git://192.168.10.1/platform/manifest.git

$ cd manifest.git

Edit default.xml and make changes for it to point to our local server
(192.168.10.1). The only change that I have done is:


<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="korg"
- fetch="git://android.git.kernel.org/"
+ fetch="git://192.168.10.1/"
review="review.source.android.com" />
<default revision="master"
remote="korg" />

$ git commit -a
$ git push kana...@192.168.10.1:/home/git/android/platform/manifest.git

######### Setup the Android source on the developer host systems ###########
The following commands are run on a developer system (say, 192.168.10.121)

$ cd ~
$ mkdir bin
$ echo $PATH
$ curl http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo

$ cd /home/developer
$ mkdir mydroid
$ cd mydroid
$ repo init -u git://192.168.10.1/platform/manifest.git
Getting repo ...
from git://android.kernel.org/tools/repo.git
warning: no common commits
remote: Counting objects: 234, done.
remote: Compressing objects: 100% (173/173), done.
.
.
.
.
Branch default set up to track remote branch refs/remotes/origin/master.
Switched to a new branch "default"

Your Name [Developer]: developer
Your Email [deve...@gmail.com]: deve...@gmail.com

repo initialized in /home/developer/mydroid

The above command has brought in the manifest file (found under
/home/developer/mydroid/.repo/manifests/default.xml) from local server
192.168.10.1

$ repo sync
This will fetch all Android sources from local server 192.168.10.1.

I hope this has been clear and it is of help. Also look at the thread
with subject 'Using repo to work with multiple GIT repositories'. You
can find the comments provided by Shawn there.

Rex Tener

unread,
Dec 26, 2008, 1:02:00 AM12/26/08
to Repo and Gerrit Discussion
On Dec 17, 1:38 am, "kanagesh radhakrishnan" <rkanag...@gmail.com>
wrote:
> $ repo sync
> This will fetch all Android sources from local server 192.168.10.1.
>
> I hope this has been clear and it is of help.  Also look at the thread
> with subject 'Using repo to work with multiple GIT repositories'.  You
> can find the comments provided by Shawn there.

Thanks Radhakrishnan for the great information.

I am having an issue when I update my server by performing a "repo
sync". It over writes my default.xml and I lose the reference to my
local server. Are you experiencing the same issue?

Thanks,
--
Rex

lingy...@gmail.com

unread,
Jan 5, 2009, 12:56:27 AM1/5/09
to Repo and Gerrit Discussion
Radhakrishnan,

Thank you for your great information!

I followed your steps, but failed at the last step. Do you know what's
the issue ?
$ repo sync
fatal: The remote end hung up unexpectedly
error: Cannot fetch platform/bionic

Thank you !
Emily

On Dec 26 2008, 2:02 pm, Rex Tener <rexte...@gmail.com> wrote:
> On Dec 17, 1:38 am, "kanagesh radhakrishnan" <rkanag...@gmail.com>
> wrote:
>
> > $reposync
> > This will fetch all Android sources from local server 192.168.10.1.
>
> > I hope this has been clear and it is of help.  Also look at the thread
> > with subject 'Usingrepoto work with multiple GIT repositories'.  You

lingy...@gmail.com

unread,
Jan 5, 2009, 1:51:40 AM1/5/09
to Repo and Gerrit Discussion
Oh, I find the root cause. I didn't add the full path of URL in
default.xml.
Sorry for boring you! :)

Emily

On Jan 5, 1:56 pm, "lingyan....@gmail.com" <lingyan....@gmail.com>
wrote:
> > Rex- Hide quoted text -
>
> - Show quoted text -

kanagesh radhakrishnan

unread,
Jan 7, 2009, 1:56:10 AM1/7/09
to repo-d...@googlegroups.com
Hello All,

Apologies for the delayed reply. I've been busy with some other
things and I haven't been able to spend a lot of time completing the
setup I want!

Yes, I am facing that problem. The local manifest file is overwritten
when you do a repo sync on the server machine.

You can avoid this by:

1. Changing the location of the local manifest file.
Instead of modifying the default manifest file to point to your local
repo server, use another manifest file other than the one at
platfrom/manifest.

2. Host your local server on a different branch.
This is something that I haven't tried with repo, but am quite
successful doing with just a single GIT repository for another project
where we host a Linux kernel GIT.

Here's how this works:
* When we clone from the GIT server from kernel.org, the default head
is at 'master'.
* We create a new branch (devel) and export that to the developers
using the local server.
* Whenever we need to sync up with the main server (kernel.org) we
change to branch 'master' on the local server
* Then pull in latest changes (with git-pull command)
* Merge the latest changes to branch 'devel' (using 'git-rebase
master' on the devel branch).
* Handle conflicts manually before exporting the devel branch to the
local developers.

Thinking on the same lines, repo provides a command to create a new
branch () I am looking at the possibility of creating a new branch
(devel) which will be exported on the local server. Whenever I want
to do a 'repo sync' to pull in latest changes from the Android main
sources, I will change to the main tree (master, I presume), do a
repo-sync, merge the changes with tree devel and then export tree
devel to the developers using the local server.

Now when the developer does a repo sync on his/her Android source, it
should pull in the updated changes being hosted on the devel tree of
the local server.

I need to test this though, will send an update once done. On the
other hand if you have found a work around, please let me know :-)

Warm regards,
Kanagesh

lingy...@gmail.com

unread,
Jan 7, 2009, 10:16:29 PM1/7/09
to Repo and Gerrit Discussion
Kanagesh,

Good Idea ! I have same requirement with you.

There's no master branch in repo which is synced from android main
source. Maybe we need to create own_master branch first.
$ cd kernel
$ git branch
* (no branch)

Thanks,
Emily
Reply all
Reply to author
Forward
0 new messages