I have rolled a Gerrit instance for my organization, got LDAP
authentication going, and have imported some working copies of Android,
manually. Cool.
The working copies do not include references to the upstream (remote)
branches, however. For a given project, say frameworks/base, what I’d
hope to achieve is:
git branch -r
# See Google branches
git rebase # to a Google branch.
git push # back to my Gerrit instance.
How do I ensure that my local git repos are aware of the upstream
projects, as above? Do I need to mirror the AOSP content, locally?
I have tried reading some documentation, and also simply adding a remote
delcation for Google to my manifest xml. Push replication is covered
widely, but this is not my use case, as I want to track remote branches,
not push my local changes back up to them.
Thank you!
As far as I know, most teams use a script which will pull down the Google version of Android and push it directly to their Gerrit servers, bypassing review. There is no setting in the manifest xml file which can help with this.
Some Android shops want to use a different namespace for the upstream branches and tags. For example, rather than
masterandfroyobranches and theandroid-4.1.1_r6tag, they might prefix everything withexternal–external/master,external/froyo, andexternal/android-4.1.1_r6.Other shops prefix their internal branches and tags in a similar fashion.
Your script to do this work will look similar to this (untested). First set up a local repo clone from upstream using the
--mirroroption.You can, of course, use a cron job to automate this script. Once this is in place, when developers run
git branch -rthey will see the origin/external/blah branches from upstream and can rebase based on those branches.