After I have downloaded a gingerbread system build using the following commands, h开发者_StackOverflow中文版ow do I later come back and find which Android tag it was derived from?
repo init -u git://android.git.kernel.org/platform/manifest.git -b gingerbread
repo sync
NOTE: The 'gingerbread' tag above seems to be a 'rolling' tag that moves as and when google releases a new gingerbread build. I would like to find out the tag with the release number in, e.g: android-2.3.1_r1
gingerbread
is indeed a "rolling tag", which is what we usually call a branch. :)
The gingerbread
branch will contain the latest gingerbread release + patches received accecpted through the AOSP (usually called gingerbread+AOSP).
Running the command git describe
should provide you with the latest tag your current commit is based on:
$ git describe
android-2.3.3_r1a-49-gaa0ddd0
However you cannot do this for the entire Andorid repo, only for the individual git repositories. Fortunately they are all tagged with the same tag for each release, such as android-2.3.3_rx
.
Run:
$ repo forall -c "pwd; git describe"
to get the latest tag for all the repositories in the Android repo hierarchy.
The repo tool keeps track of the -u
and -b
option arguments in the .repo/manifests
git repo.
To find out the -u
option argument, see the origin
remote in .repo/manifests
:
(cd .repo/manifests; git remote -v)
Then look for for the url.
To find out the -b
option argument, see what branch the local default
branch tracks:
(cd .repo/manifests; git config branch.default.merge)
Note that the branch that you specify to repo init
with -b
is the branch in the manifest git repo. It is the manifest.xml
that then defines the branch or commit for each individual projects.
Perhaps more obviously, the -m
option defines the file that .repo/manifest.xml
points to.
精彩评论