blob: 777840998b95cc9a66090a439c8d210504d84aa2 [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*,
Josh Triplett884a3872014-06-12 14:57:29 -070029 extend-project*,
Jiri tyrfddfa6f2017-01-09 23:47:52 +000030 repo-hooks?,
31 include*)>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053032
Doug Anderson2b8db3c2010-11-01 15:08:06 -070033 <!ELEMENT notice (#PCDATA)>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053034
Mike Frysinger04071c12016-12-28 16:07:16 -050035 <!ELEMENT remote EMPTY>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080036 <!ATTLIST remote name ID #REQUIRED>
Yestin Sunb292b982012-07-02 07:32:50 -070037 <!ATTLIST remote alias CDATA #IMPLIED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080038 <!ATTLIST remote fetch CDATA #REQUIRED>
Steve Raed6480452016-08-10 15:00:00 -070039 <!ATTLIST remote pushurl CDATA #IMPLIED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080040 <!ATTLIST remote review CDATA #IMPLIED>
Anthony King36ea2fb2014-05-06 11:54:01 +010041 <!ATTLIST remote revision CDATA #IMPLIED>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053042
Mike Frysinger04071c12016-12-28 16:07:16 -050043 <!ELEMENT default EMPTY>
Bryan Jacobsf609f912013-05-06 13:36:24 -040044 <!ATTLIST default remote IDREF #IMPLIED>
45 <!ATTLIST default revision CDATA #IMPLIED>
46 <!ATTLIST default dest-branch CDATA #IMPLIED>
47 <!ATTLIST default sync-j CDATA #IMPLIED>
48 <!ATTLIST default sync-c CDATA #IMPLIED>
49 <!ATTLIST default sync-s CDATA #IMPLIED>
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070050
Mike Frysinger04071c12016-12-28 16:07:16 -050051 <!ELEMENT manifest-server EMPTY>
Kenny Ho827e5472015-10-22 20:59:42 +000052 <!ATTLIST manifest-server url CDATA #REQUIRED>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053053
Warren Turkal53d6a7b2013-12-10 15:30:03 -080054 <!ELEMENT project (annotation*,
Ruslan Bilovol54527e72015-09-08 13:11:23 +030055 project*,
Kenny Ho827e5472015-10-22 20:59:42 +000056 copyfile*,
57 linkfile*)>
Bryan Jacobsf609f912013-05-06 13:36:24 -040058 <!ATTLIST project name CDATA #REQUIRED>
59 <!ATTLIST project path CDATA #IMPLIED>
60 <!ATTLIST project remote IDREF #IMPLIED>
61 <!ATTLIST project revision CDATA #IMPLIED>
62 <!ATTLIST project dest-branch CDATA #IMPLIED>
63 <!ATTLIST project groups CDATA #IMPLIED>
64 <!ATTLIST project sync-c CDATA #IMPLIED>
65 <!ATTLIST project sync-s CDATA #IMPLIED>
David Pursehouse4e465202012-11-27 22:20:10 +090066 <!ATTLIST project upstream CDATA #IMPLIED>
David Pursehouseede7f122012-11-27 22:25:30 +090067 <!ATTLIST project clone-depth CDATA #IMPLIED>
Scott Fandb83b1b2013-02-28 09:34:14 +080068 <!ATTLIST project force-path CDATA #IMPLIED>
James W. Mills24c13082012-04-12 15:04:13 -050069
Mike Frysinger04071c12016-12-28 16:07:16 -050070 <!ELEMENT annotation EMPTY>
James W. Mills24c13082012-04-12 15:04:13 -050071 <!ATTLIST annotation name CDATA #REQUIRED>
72 <!ATTLIST annotation value CDATA #REQUIRED>
73 <!ATTLIST annotation keep CDATA "true">
Chirayu Desaid5a5b192013-11-21 19:15:30 +053074
Mike Frysinger04071c12016-12-28 16:07:16 -050075 <!ELEMENT copyfile EMPTY>
Kenny Ho827e5472015-10-22 20:59:42 +000076 <!ATTLIST copyfile src CDATA #REQUIRED>
77 <!ATTLIST copyfile dest CDATA #REQUIRED>
Ruslan Bilovol54527e72015-09-08 13:11:23 +030078
Mike Frysinger04071c12016-12-28 16:07:16 -050079 <!ELEMENT linkfile EMPTY>
Kenny Ho827e5472015-10-22 20:59:42 +000080 <!ATTLIST linkfile src CDATA #REQUIRED>
81 <!ATTLIST linkfile dest CDATA #REQUIRED>
Ruslan Bilovol54527e72015-09-08 13:11:23 +030082
Mike Frysinger04071c12016-12-28 16:07:16 -050083 <!ELEMENT extend-project EMPTY>
Josh Triplett884a3872014-06-12 14:57:29 -070084 <!ATTLIST extend-project name CDATA #REQUIRED>
85 <!ATTLIST extend-project path CDATA #IMPLIED>
86 <!ATTLIST extend-project groups CDATA #IMPLIED>
87
Mike Frysinger04071c12016-12-28 16:07:16 -050088 <!ELEMENT remove-project EMPTY>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080089 <!ATTLIST remove-project name CDATA #REQUIRED>
Doug Anderson37282b42011-03-04 11:54:18 -080090
Mike Frysinger04071c12016-12-28 16:07:16 -050091 <!ELEMENT repo-hooks EMPTY>
Doug Anderson37282b42011-03-04 11:54:18 -080092 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
93 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Brian Harring26448742011-04-28 05:04:41 -070094
Mike Frysinger04071c12016-12-28 16:07:16 -050095 <!ELEMENT include EMPTY>
Brian Harring26448742011-04-28 05:04:41 -070096 <!ATTLIST include name CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080097 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080098
99A description of the elements and their attributes follows.
100
101
102Element manifest
103----------------
104
105The root element of the file.
106
107
108Element remote
109--------------
110
111One or more remote elements may be specified. Each remote element
112specifies a Git URL shared by one or more projects and (optionally)
113the Gerrit review server those projects upload changes through.
114
115Attribute `name`: A short name unique to this manifest file. The
116name specified here is used as the remote name in each project's
117.git/config, and is therefore automatically available to commands
118like `git fetch`, `git remote`, `git pull` and `git push`.
119
Yestin Sunb292b982012-07-02 07:32:50 -0700120Attribute `alias`: The alias, if specified, is used to override
121`name` to be set as the remote name in each project's .git/config.
122Its value can be duplicated while attribute `name` has to be unique
123in the manifest file. This helps each project to be able to have
124same remote name which actually points to different remote url.
125
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800126Attribute `fetch`: The Git URL prefix for all projects which use
127this remote. Each project's name is appended to this prefix to
128form the actual URL used to clone the project.
129
Steve Raed6480452016-08-10 15:00:00 -0700130Attribute `pushurl`: The Git "push" URL prefix for all projects
131which use this remote. Each project's name is appended to this
132prefix to form the actual URL used to "git push" the project.
133This attribute is optional; if not specified then "git push"
134will use the same URL as the `fetch` attribute.
135
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800136Attribute `review`: Hostname of the Gerrit server where reviews
137are uploaded to by `repo upload`. This attribute is optional;
138if not specified then `repo upload` will not function.
139
Anthony King36ea2fb2014-05-06 11:54:01 +0100140Attribute `revision`: Name of a Git branch (e.g. `master` or
141`refs/heads/master`). Remotes with their own revision will override
142the default revision.
143
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800144Element default
145---------------
146
147At most one default element may be specified. Its remote and
148revision attributes are used when a project element does not
149specify its own remote or revision attribute.
150
151Attribute `remote`: Name of a previously defined remote element.
152Project elements lacking a remote attribute of their own will use
153this remote.
154
155Attribute `revision`: Name of a Git branch (e.g. `master` or
156`refs/heads/master`). Project elements lacking their own
157revision attribute will use this revision.
158
Bryan Jacobsf609f912013-05-06 13:36:24 -0400159Attribute `dest-branch`: Name of a Git branch (e.g. `master`).
160Project elements not setting their own `dest-branch` will inherit
161this value. If this value is not set, projects will use `revision`
162by default instead.
163
Mani Chandel7a91d512014-07-24 16:27:08 +0530164Attribute `sync-j`: Number of parallel jobs to use when synching.
David Pursehouse4e465202012-11-27 22:20:10 +0900165
Mani Chandel7a91d512014-07-24 16:27:08 +0530166Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900167branch (specified in the `revision` attribute) rather than the
Mani Chandel7a91d512014-07-24 16:27:08 +0530168whole ref space. Project elements lacking a sync-c element of
David Pursehouse4e465202012-11-27 22:20:10 +0900169their own will use this value.
170
Mani Chandel7a91d512014-07-24 16:27:08 +0530171Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900172
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800173
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700174Element manifest-server
175-----------------------
176
177At most one manifest-server may be specified. The url attribute
178is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900179XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700180
David Pursehouse9a27d012012-08-21 14:23:49 +0900181The manifest server should implement the following RPC methods:
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700182
183 GetApprovedManifest(branch, target)
184
David Pursehouse9a27d012012-08-21 14:23:49 +0900185Return a manifest in which each project is pegged to a known good revision
David Pursehousee8688412016-04-13 17:55:34 +0900186for the current branch and target. This is used by repo sync when the
187--smart-sync option is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900188
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700189The target to use is defined by environment variables TARGET_PRODUCT
190and TARGET_BUILD_VARIANT. These variables are used to create a string
191of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
192If one of those variables or both are not present, the program will call
David Pursehousedaa851f2012-08-21 13:52:18 +0900193GetApprovedManifest without the target parameter and the manifest server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700194should choose a reasonable default target.
195
David Pursehouse9a27d012012-08-21 14:23:49 +0900196 GetManifest(tag)
197
198Return a manifest in which each project is pegged to the revision at
David Pursehousee8688412016-04-13 17:55:34 +0900199the specified tag. This is used by repo sync when the --smart-tag option
200is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900201
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700202
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800203Element project
204---------------
205
206One or more project elements may be specified. Each element
207describes a single Git repository to be cloned into the repo
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800208client workspace. You may specify Git-submodules by creating a
209nested project. Git-submodules will be automatically
210recognized and inherit their parent's attributes, but those
211may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800212
213Attribute `name`: A unique name for this project. The project's
214name is appended onto its remote's fetch URL to generate the actual
215URL to configure the Git remote with. The URL gets formed as:
216
217 ${remote_fetch}/${project_name}.git
218
219where ${remote_fetch} is the remote's fetch attribute and
220${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900221is always appended as repo assumes the upstream is a forest of
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800222bare Git repositories. If the project has a parent element, its
223name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800224
225The project name must match the name Gerrit knows, if Gerrit is
226being used for code reviews.
227
228Attribute `path`: An optional path relative to the top directory
229of the repo client where the Git working directory for this project
230should be placed. If not supplied the project name is used.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800231If the project has a parent element, its path will be prefixed
232by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800233
234Attribute `remote`: Name of a previously defined remote element.
235If not supplied the remote given by the default element is used.
236
237Attribute `revision`: Name of the Git branch the manifest wants
238to track for this project. Names can be relative to refs/heads
239(e.g. just "master") or absolute (e.g. "refs/heads/master").
240Tags and/or explicit SHA-1s should work in theory, but have not
241been extensively tested. If not supplied the revision given by
Anthony King36ea2fb2014-05-06 11:54:01 +0100242the remote element is used if applicable, else the default
243element is used.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800244
Bryan Jacobsf609f912013-05-06 13:36:24 -0400245Attribute `dest-branch`: Name of a Git branch (e.g. `master`).
246When using `repo upload`, changes will be submitted for code
247review on this branch. If unspecified both here and in the
248default element, `revision` is used instead.
249
Colin Cross5acde752012-03-28 20:15:45 -0700250Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700251whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700252"all", and each project automatically belongs to a group of
253its name:`name` and path:`path`. E.g. for
Brian Harring7da13142012-06-15 02:24:20 -0700254<project name="monkeys" path="barrel-of"/>, that project
255definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700256default, name:monkeys, and path:barrel-of. If you place a project in the
257group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800258If the project has a parent element, the `name` and `path` here
259are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700260
Mani Chandel7a91d512014-07-24 16:27:08 +0530261Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900262branch (specified in the `revision` attribute) rather than the
263whole ref space.
264
Mani Chandel7a91d512014-07-24 16:27:08 +0530265Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900266
Nasser Grainawi909d58b2014-09-19 12:13:04 -0600267Attribute `upstream`: Name of the Git ref in which a sha1
David Pursehouse4e465202012-11-27 22:20:10 +0900268can be found. Used when syncing a revision locked manifest in
269-c mode to avoid having to sync the entire ref space.
270
David Pursehouseede7f122012-11-27 22:25:30 +0900271Attribute `clone-depth`: Set the depth to use when fetching this
272project. If specified, this value will override any value given
273to repo init with the --depth option on the command line.
274
Scott Fandb83b1b2013-02-28 09:34:14 +0800275Attribute `force-path`: Set to true to force this project to create the
276local mirror repository according to its `path` attribute (if supplied)
277rather than the `name` attribute. This attribute only applies to the
278local mirrors syncing, it will be ignored when syncing the projects in a
279client working directory.
280
Josh Triplett884a3872014-06-12 14:57:29 -0700281Element extend-project
282----------------------
283
284Modify the attributes of the named project.
285
286This element is mostly useful in a local manifest file, to modify the
287attributes of an existing project without completely replacing the
288existing project definition. This makes the local manifest more robust
289against changes to the original manifest.
290
291Attribute `path`: If specified, limit the change to projects checked out
292at the specified path, rather than all projects with the given name.
293
294Attribute `groups`: List of additional groups to which this project
295belongs. Same syntax as the corresponding element of `project`.
296
James W. Mills24c13082012-04-12 15:04:13 -0500297Element annotation
298------------------
299
300Zero or more annotation elements may be specified as children of a
301project element. Each element describes a name-value pair that will be
302exported into each project's environment during a 'forall' command,
303prefixed with REPO__. In addition, there is an optional attribute
304"keep" which accepts the case insensitive values "true" (default) or
305"false". This attribute determines whether or not the annotation will
306be kept when exported with the manifest subcommand.
307
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300308Element copyfile
309----------------
310
311Zero or more copyfile elements may be specified as children of a
312project element. Each element describes a src-dest pair of files;
313the "src" file will be copied to the "dest" place during 'repo sync'
314command.
315"src" is project relative, "dest" is relative to the top of the tree.
316
317Element linkfile
318----------------
319
320It's just like copyfile and runs at the same time as copyfile but
321instead of copying it creates a symlink.
322
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800323Element remove-project
324----------------------
325
326Deletes the named project from the internal manifest table, possibly
327allowing a subsequent project element in the same manifest file to
328replace the project with a different source.
329
David Pursehouseb1525bf2012-11-14 08:51:38 +0900330This element is mostly useful in a local manifest file, where
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800331the user can remove a project, and possibly replace it with their
332own definition.
333
Brian Harring26448742011-04-28 05:04:41 -0700334Element include
335---------------
336
337This element provides the capability of including another manifest
338file into the originating manifest. Normal rules apply for the
David Pursehouse9f3406e2012-11-14 08:52:25 +0900339target manifest to include - it must be a usable manifest on its own.
Brian Harring26448742011-04-28 05:04:41 -0700340
David Pursehouse9f3406e2012-11-14 08:52:25 +0900341Attribute `name`: the manifest to include, specified relative to
342the manifest repository's root.
Brian Harring26448742011-04-28 05:04:41 -0700343
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800344
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900345Local Manifests
346===============
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800347
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900348Additional remotes and projects may be added through local manifest
349files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800350
351For example:
352
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900353 $ ls .repo/local_manifests
354 local_manifest.xml
355 another_local_manifest.xml
356
357 $ cat .repo/local_manifests/local_manifest.xml
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800358 <?xml version="1.0" encoding="UTF-8"?>
359 <manifest>
360 <project path="manifest"
361 name="tools/manifest" />
362 <project path="platform-manifest"
363 name="platform/manifest" />
364 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800365
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900366Users may add projects to the local manifest(s) prior to a `repo sync`
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800367invocation, instructing repo to automatically download and manage
368these extra projects.
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900369
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900370Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
371be loaded in alphabetical order.
372
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900373Additional remotes and projects may also be added through a local
David Pursehouse5566ae52012-11-13 03:04:18 +0900374manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method
375is deprecated in favor of using multiple manifest files as mentioned
376above.
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900377
378If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before
379any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.