blob: a36af67c8df1b1f5d5e99cbc5ce8102d28c44d02 [file] [log] [blame]
Shawn O. Pearce3e548192008-11-04 11:19:36 -08001repo Manifest Format
2====================
3
4A repo manifest describes the structure of a repo client; that is
5the directories that are visible and where they should be obtained
6from with git.
7
8The basic structure of a manifest is a bare Git repository holding
9a single 'default.xml' XML file in the top level directory.
10
11Manifests are inherently version controlled, since they are kept
12within a Git repository. Updates to manifests are automatically
13obtained by clients during `repo sync`.
14
15
16XML File Format
17---------------
18
19A manifest XML file (e.g. 'default.xml') roughly conforms to the
20following DTD:
21
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080022 <!DOCTYPE manifest [
Doug Anderson2b8db3c2010-11-01 15:08:06 -070023 <!ELEMENT manifest (notice?,
24 remote*,
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080025 default?,
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070026 manifest-server?,
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080027 remove-project*,
Doug Anderson37282b42011-03-04 11:54:18 -080028 project*,
29 repo-hooks?)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080030
Doug Anderson2b8db3c2010-11-01 15:08:06 -070031 <!ELEMENT notice (#PCDATA)>
32
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080033 <!ELEMENT remote (EMPTY)>
34 <!ATTLIST remote name ID #REQUIRED>
Yestin Sunb292b982012-07-02 07:32:50 -070035 <!ATTLIST remote alias CDATA #IMPLIED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080036 <!ATTLIST remote fetch CDATA #REQUIRED>
37 <!ATTLIST remote review CDATA #IMPLIED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080038
39 <!ELEMENT default (EMPTY)>
40 <!ATTLIST default remote IDREF #IMPLIED>
41 <!ATTLIST default revision CDATA #IMPLIED>
Shawn O. Pearce6392c872011-09-22 17:44:31 -070042 <!ATTLIST default sync-j CDATA #IMPLIED>
Anatol Pomazau79770d22012-04-20 14:41:59 -070043 <!ATTLIST default sync-c CDATA #IMPLIED>
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070044
45 <!ELEMENT manifest-server (EMPTY)>
46 <!ATTLIST url CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080047
Che-Liang Chiou69998b02012-01-11 11:28:42 +080048 <!ELEMENT project (annotation?,
49 project*)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080050 <!ATTLIST project name CDATA #REQUIRED>
51 <!ATTLIST project path CDATA #IMPLIED>
52 <!ATTLIST project remote IDREF #IMPLIED>
53 <!ATTLIST project revision CDATA #IMPLIED>
Colin Cross5acde752012-03-28 20:15:45 -070054 <!ATTLIST project groups CDATA #IMPLIED>
Anatol Pomazau79770d22012-04-20 14:41:59 -070055 <!ATTLIST project sync-c CDATA #IMPLIED>
James W. Mills24c13082012-04-12 15:04:13 -050056
57 <!ELEMENT annotation (EMPTY)>
58 <!ATTLIST annotation name CDATA #REQUIRED>
59 <!ATTLIST annotation value CDATA #REQUIRED>
60 <!ATTLIST annotation keep CDATA "true">
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080061
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080062 <!ELEMENT remove-project (EMPTY)>
63 <!ATTLIST remove-project name CDATA #REQUIRED>
Doug Anderson37282b42011-03-04 11:54:18 -080064
65 <!ELEMENT repo-hooks (EMPTY)>
66 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
67 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Brian Harring26448742011-04-28 05:04:41 -070068
69 <!ELEMENT include (EMPTY)>
70 <!ATTLIST include name CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080071 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080072
73A description of the elements and their attributes follows.
74
75
76Element manifest
77----------------
78
79The root element of the file.
80
81
82Element remote
83--------------
84
85One or more remote elements may be specified. Each remote element
86specifies a Git URL shared by one or more projects and (optionally)
87the Gerrit review server those projects upload changes through.
88
89Attribute `name`: A short name unique to this manifest file. The
90name specified here is used as the remote name in each project's
91.git/config, and is therefore automatically available to commands
92like `git fetch`, `git remote`, `git pull` and `git push`.
93
Yestin Sunb292b982012-07-02 07:32:50 -070094Attribute `alias`: The alias, if specified, is used to override
95`name` to be set as the remote name in each project's .git/config.
96Its value can be duplicated while attribute `name` has to be unique
97in the manifest file. This helps each project to be able to have
98same remote name which actually points to different remote url.
99
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800100Attribute `fetch`: The Git URL prefix for all projects which use
101this remote. Each project's name is appended to this prefix to
102form the actual URL used to clone the project.
103
104Attribute `review`: Hostname of the Gerrit server where reviews
105are uploaded to by `repo upload`. This attribute is optional;
106if not specified then `repo upload` will not function.
107
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800108Element default
109---------------
110
111At most one default element may be specified. Its remote and
112revision attributes are used when a project element does not
113specify its own remote or revision attribute.
114
115Attribute `remote`: Name of a previously defined remote element.
116Project elements lacking a remote attribute of their own will use
117this remote.
118
119Attribute `revision`: Name of a Git branch (e.g. `master` or
120`refs/heads/master`). Project elements lacking their own
121revision attribute will use this revision.
122
123
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700124Element manifest-server
125-----------------------
126
127At most one manifest-server may be specified. The url attribute
128is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900129XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700130
David Pursehouse9a27d012012-08-21 14:23:49 +0900131The manifest server should implement the following RPC methods:
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700132
133 GetApprovedManifest(branch, target)
134
David Pursehouse9a27d012012-08-21 14:23:49 +0900135Return a manifest in which each project is pegged to a known good revision
136for the current branch and target.
137
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700138The target to use is defined by environment variables TARGET_PRODUCT
139and TARGET_BUILD_VARIANT. These variables are used to create a string
140of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
141If one of those variables or both are not present, the program will call
David Pursehousedaa851f2012-08-21 13:52:18 +0900142GetApprovedManifest without the target parameter and the manifest server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700143should choose a reasonable default target.
144
David Pursehouse9a27d012012-08-21 14:23:49 +0900145 GetManifest(tag)
146
147Return a manifest in which each project is pegged to the revision at
148the specified tag.
149
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700150
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800151Element project
152---------------
153
154One or more project elements may be specified. Each element
155describes a single Git repository to be cloned into the repo
Che-Liang Chiou69998b02012-01-11 11:28:42 +0800156client workspace. You may specify Git-submodules by creating a
157nested project. Git-submodules will be automatically
158recognized and inherit their parent's attributes, but those
159may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800160
161Attribute `name`: A unique name for this project. The project's
162name is appended onto its remote's fetch URL to generate the actual
163URL to configure the Git remote with. The URL gets formed as:
164
165 ${remote_fetch}/${project_name}.git
166
167where ${remote_fetch} is the remote's fetch attribute and
168${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900169is always appended as repo assumes the upstream is a forest of
Che-Liang Chiou69998b02012-01-11 11:28:42 +0800170bare Git repositories. If the project has a parent element, its
171name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800172
173The project name must match the name Gerrit knows, if Gerrit is
174being used for code reviews.
175
176Attribute `path`: An optional path relative to the top directory
177of the repo client where the Git working directory for this project
178should be placed. If not supplied the project name is used.
Che-Liang Chiou69998b02012-01-11 11:28:42 +0800179If the project has a parent element, its path will be prefixed
180by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800181
182Attribute `remote`: Name of a previously defined remote element.
183If not supplied the remote given by the default element is used.
184
185Attribute `revision`: Name of the Git branch the manifest wants
186to track for this project. Names can be relative to refs/heads
187(e.g. just "master") or absolute (e.g. "refs/heads/master").
188Tags and/or explicit SHA-1s should work in theory, but have not
189been extensively tested. If not supplied the revision given by
190the default element is used.
191
Colin Cross5acde752012-03-28 20:15:45 -0700192Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700193whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700194"all", and each project automatically belongs to a group of
195its name:`name` and path:`path`. E.g. for
Brian Harring7da13142012-06-15 02:24:20 -0700196<project name="monkeys" path="barrel-of"/>, that project
197definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700198default, name:monkeys, and path:barrel-of. If you place a project in the
199group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chiou69998b02012-01-11 11:28:42 +0800200If the project has a parent element, the `name` and `path` here
201are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700202
James W. Mills24c13082012-04-12 15:04:13 -0500203Element annotation
204------------------
205
206Zero or more annotation elements may be specified as children of a
207project element. Each element describes a name-value pair that will be
208exported into each project's environment during a 'forall' command,
209prefixed with REPO__. In addition, there is an optional attribute
210"keep" which accepts the case insensitive values "true" (default) or
211"false". This attribute determines whether or not the annotation will
212be kept when exported with the manifest subcommand.
213
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800214Element remove-project
215----------------------
216
217Deletes the named project from the internal manifest table, possibly
218allowing a subsequent project element in the same manifest file to
219replace the project with a different source.
220
221This element is mostly useful in the local_manifest.xml, where
222the user can remove a project, and possibly replace it with their
223own definition.
224
Brian Harring26448742011-04-28 05:04:41 -0700225Element include
226---------------
227
228This element provides the capability of including another manifest
229file into the originating manifest. Normal rules apply for the
230target manifest to include- it must be a usable manifest on it's own.
231
232Attribute `name`; the manifest to include, specified relative to
233the manifest repositories root.
234
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800235
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800236Local Manifest
237==============
238
239Additional remotes and projects may be added through a local
240manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`.
241
242For example:
243
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800244 $ cat .repo/local_manifest.xml
245 <?xml version="1.0" encoding="UTF-8"?>
246 <manifest>
247 <project path="manifest"
248 name="tools/manifest" />
249 <project path="platform-manifest"
250 name="platform/manifest" />
251 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800252
253Users may add projects to the local manifest prior to a `repo sync`
254invocation, instructing repo to automatically download and manage
255these extra projects.