local_manifest

1,394 views
Skip to first unread message

Entringer Robert-W19085

unread,
Mar 5, 2009, 12:49:54 PM3/5/09
to repo-d...@googlegroups.com, Dhar Sanjay-CSD004, Woodruff Steve-CSW000, Borgelt Ken-CKB009
Is there any documentation on how to use local manifest?
 
Can I get local manifest to fetch from another location from the main manifest?
 
Can I have multiple manifest?  Like 2 or more local manifests?
 
What needs to be in the local manifest?
 
 
If I need to remove a project, can the local manifest do that just once?  If I do a repo sync again, do I need to modify the local manifest?
 
 
Thanks for all the support.

Shawn Pearce

unread,
Mar 5, 2009, 12:56:17 PM3/5/09
to repo-d...@googlegroups.com, Dhar Sanjay-CSD004, Woodruff Steve-CSW000, Borgelt Ken-CKB009
On Thu, Mar 5, 2009 at 09:49, Entringer Robert-W19085 <Robert.E...@motorola.com> wrote:
Is there any documentation on how to use local manifest? 
Can I get local manifest to fetch from another location from the main manifest? 

Yes.  The local manifest is inlined into the same in-memory data structure as the main manifest.  You can reference remotes by name that were declared in the main manifest.  You can use the <add-remote> tag to inject an additional remote for a project.  But you can't change the default remote for a project; to do that you need to remove the project in the local manifest, then add the project back in with the same name/path.
 
Can I have multiple manifest?  Like 2 or more local manifests? 

No.  Only the main manifest, and an optional local, are supported.
 
What needs to be in the local manifest?

Just a <manifest> root element, and then whatever other tags you decided to include to massage your client to your needs.
 
If I need to remove a project, can the local manifest do that just once?

Yes.  Just put the <remove-project> tag in the local manifest *before* the first sync.  Once a project is sync'd repo doesn't remove it, even if the manifest says to remove it.
 
  If I do a repo sync again, do I need to modify the local manifest? 

No.  The local manifest is never modified by repo.


Aravind Mahishi

unread,
Mar 6, 2009, 4:49:02 AM3/6/09
to repo-d...@googlegroups.com
Does this local manifest also work for mirrored Android?
I would like to know more info how to setup my own remote branch for all the projects and when developers sync from my internal mirror they should only see the remote branch which i created new and not all the branch from korg/*

Any tips on this will be helpful.
Thanks in advance.

Shawn Pearce

unread,
Mar 6, 2009, 11:48:38 AM3/6/09
to repo-d...@googlegroups.com
On Fri, Mar 6, 2009 at 01:49, Aravind Mahishi <amah...@gmail.com> wrote:
Does this local manifest also work for mirrored Android?

Yes.  A .repo/local_manifest.xml can also be used in a client initialized with --mirror.
 
I would like to know more info how to setup my own remote branch for all the projects and when developers sync from my internal mirror they should only see the remote branch which i created new and not all the branch from korg/*

Currently do to this you need to edit the manifest you are serving to users.  E.g.

  git clone ...your.mirror.../platform/manifest.git
  cd manifest
  git checkout -b int-master
  vi default.xml
    # change <remote> and <default> as you see fit, e.g.

    <remote name="int" fetch="int.server:/srv/git/android/" />
    <default remote="int" revision="master" />

  git commit -a
  git push origin int-master

Now have developers initialize off the int-master manifest branch:

  repo init -u ...your.mirror.../platform/manifest.git -b int-master

and they won't see "korg" anymore.  Instead they talk only to your mirror, and see only what is available on that.  Plus you have more control over what projects they are mapping into their clients, so you can map additional projects, or less, depending on what the team might require.

If the upstream manifest changes, you can clone the project again, and use git merge to bring the updates into your local manifest.

Aravind

unread,
Mar 9, 2009, 5:22:18 AM3/9/09
to Repo and Gerrit Discussion
Thank you Shawn.
This works perfectly fine as i want.

But i would like to have a little more enhancement.

I have developers working on internal branches and once they are
finished they would push the branch to the local mirror which i have
created.
So the new pushed branch will be available on the next sync as a
remote branch for other developers.

Is there a way to restrict only selected branches instead of getting
all the remote branches when doing a repo sync?


On Mar 6, 5:48 pm, Shawn Pearce <s...@google.com> wrote:

Shawn Pearce

unread,
Mar 9, 2009, 10:17:40 AM3/9/09
to repo-d...@googlegroups.com
On Mon, Mar 9, 2009 at 02:22, Aravind <amah...@gmail.com> wrote:
I have developers working on internal branches and once they are
finished they would push the branch to the local mirror which i have
created.
So the new pushed branch will be available on the next sync as a
remote branch for other developers.

Is there a way to restrict only selected branches instead of getting
all the remote branches when doing a repo sync?

No.  repo is hard-coded to always grab refs/heads/* when fetching from a remote.

The way I worked around this on prior projects is to have developers push their new branches into a different namespace.  E.g. "refs/dev/*".  This is just as valid of a namespace to git as "refs/heads/", but it won't be automatically pattern matched during fetch.

This however does mean its harder to push the branch, e.g. you would need to say:

  git push origin mytask:refs/dev/mytask

You could ask developers to use an alias such as:

  git config --global alias.dev '!h=$(git symbolic-ref HEAD);git push origin HEAD:refs/dev/${h##refs/heads/}'

and then just say:

  git dev

to upload the currently checked out branch to refs/dev/.
Reply all
Reply to author
Forward
0 new messages