Repo initiates specific commit

Im building a system of Cyanogenmod 9 (Android ICS) for a Nexus S phone (samsung crespo). The problem is that if I do this:

repo init -u git://github.com/CyanogenMod/android.git -b ics 

The repo introduces the latest ICS commit, in which the manifest does not contain some devices / samsung / projects that I need (in particular https://github.com/CyanogenMod/android_device_samsung_crespo ).

How do I execute repo init for a specific commit? In my case, I want the last commit to be used in the google branch android-4.0.3_r1. This one is:

If i do

repo init -u git: //github.com/CyanogenMod/android.git -b commit-hash

It does not work, it seems that repo init -b supports only HEAD branches.

Thanks at Advance.

+4
source share
3 answers

Long answer:

You cannot specify the branch name (or SHA or something else) on the repo , this will not work. That's why:

repo is a script that processes a collection of repository projects (which are actually independent git). The list of projects is in .repo git and contains a manifest file, which basically is a list of all git repositories, and they branch. -b is only relevant to repo git during repo init .

Here is an example .repo/manifests/default.xml :

 <?xml version="1.0" encoding="UTF-8"?> <manifest> <remote fetch="git://address.com/" name="origin" review="review.address.com"/> <default remote="origin" revision="ics-something" sync-j="4"/> <manifest-server url="http://manifests.address.com:8000"/> <!-- sniff --> <project name="platform/external/libxml2" path="external/libxml2" revision="ics-common"/> <project name="platform/external/zlib" path="external/zlib" revision="ics-common"/> <project name="platform/frameworks/base" path="frameworks/base" revision="ics-something"/> <project name="platform/packages/apps/Bluetooth" path="packages/apps/Bluetooth" revision="ics-common"/> <!-- sniff --> </manifest> 

So, the correct way to get repository sources for a particular assembly is to get its manifest.
Ie, manifest, which will contain SHA (or tags that are almost the same, if present) instead of branch names. This way, every git project in your repository will point to some commit, which was the most recent when the build was done:

 <?xml version="1.0" encoding="UTF-8"?> <manifest> <remote fetch="git://address.com/" name="origin" review="review.address.com"/> <default remote="origin" revision="ics-something" sync-j="4"/> <manifest-server url="http://manifests.address.com:8000"/> <!-- sniff --> <project name="platform/external/libxml2" path="external/libxml2" revision="refs/tags/android-4.0.4_r1.1"/> <project name="platform/external/zlib" path="external/zlib" revision="refs/tags/android-4.0.4_r1.1"/> <project name="platform/frameworks/base" path="frameworks/base" revision="ecb41a77411358d385e3fde5b4e98a5f3d9cfdd5"/> <project name="platform/packages/apps/Bluetooth" path="packages/apps/Bluetooth" revision="621bae79f1a250e443eb83d1f473c533bea493dc"/> <!-- sniff --> </manifest> 

As you can see, the only difference between the two manifests is the revision values โ€‹โ€‹of the git repository.

Short answer:

You need to get manifest_static.xml specific assembly.

Or, if you just miss some git project, then you can create a local_manifest.xml file in .repo git, add the missing git there, and then repo sync from the root of your repository. More information on using local_manifest.xml here .

+5
source

I get it. If you have a tag in the manifest file (e.g. version.xml). You can reinstall init to a specific tag with the following command:

 repo init -u <addres> -b refs/tags/<tagname> -m version.xml 
+3
source

I do not have sufficient authority to send a comment, but I just wanted to clarify the answer of Andrey Kainikov.

Repo accepts a SHA commit code in addition to the ref responder as an argument to the -b option.

As the answers show, this argument indicates a revision of the manifest to be used by the repo, not a revision in any of the projects to which the manifest relates.

+1
source

Source: https://habr.com/ru/post/1415193/


All Articles