blob: 0e6cbe320c27e3c1981af69b6e4330687d796d62 [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>
YOUNG HO CHAa32c92c2018-02-14 16:57:31 +090050 <!ATTLIST default sync-tags CDATA #IMPLIED>
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070051
Mike Frysinger04071c12016-12-28 16:07:16 -050052 <!ELEMENT manifest-server EMPTY>
Kenny Ho827e5472015-10-22 20:59:42 +000053 <!ATTLIST manifest-server url CDATA #REQUIRED>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053054
Warren Turkal53d6a7b2013-12-10 15:30:03 -080055 <!ELEMENT project (annotation*,
Ruslan Bilovol54527e72015-09-08 13:11:23 +030056 project*,
Kenny Ho827e5472015-10-22 20:59:42 +000057 copyfile*,
58 linkfile*)>
Bryan Jacobsf609f912013-05-06 13:36:24 -040059 <!ATTLIST project name CDATA #REQUIRED>
60 <!ATTLIST project path CDATA #IMPLIED>
61 <!ATTLIST project remote IDREF #IMPLIED>
62 <!ATTLIST project revision CDATA #IMPLIED>
63 <!ATTLIST project dest-branch CDATA #IMPLIED>
64 <!ATTLIST project groups CDATA #IMPLIED>
65 <!ATTLIST project sync-c CDATA #IMPLIED>
66 <!ATTLIST project sync-s CDATA #IMPLIED>
YOUNG HO CHAa32c92c2018-02-14 16:57:31 +090067 <!ATTLIST default sync-tags CDATA #IMPLIED>
David Pursehouse4e465202012-11-27 22:20:10 +090068 <!ATTLIST project upstream CDATA #IMPLIED>
David Pursehouseede7f122012-11-27 22:25:30 +090069 <!ATTLIST project clone-depth CDATA #IMPLIED>
Scott Fandb83b1b2013-02-28 09:34:14 +080070 <!ATTLIST project force-path CDATA #IMPLIED>
James W. Mills24c13082012-04-12 15:04:13 -050071
Mike Frysinger04071c12016-12-28 16:07:16 -050072 <!ELEMENT annotation EMPTY>
James W. Mills24c13082012-04-12 15:04:13 -050073 <!ATTLIST annotation name CDATA #REQUIRED>
74 <!ATTLIST annotation value CDATA #REQUIRED>
75 <!ATTLIST annotation keep CDATA "true">
Chirayu Desaid5a5b192013-11-21 19:15:30 +053076
Mike Frysinger04071c12016-12-28 16:07:16 -050077 <!ELEMENT copyfile EMPTY>
Kenny Ho827e5472015-10-22 20:59:42 +000078 <!ATTLIST copyfile src CDATA #REQUIRED>
79 <!ATTLIST copyfile dest CDATA #REQUIRED>
Ruslan Bilovol54527e72015-09-08 13:11:23 +030080
Mike Frysinger04071c12016-12-28 16:07:16 -050081 <!ELEMENT linkfile EMPTY>
Kenny Ho827e5472015-10-22 20:59:42 +000082 <!ATTLIST linkfile src CDATA #REQUIRED>
83 <!ATTLIST linkfile dest CDATA #REQUIRED>
Ruslan Bilovol54527e72015-09-08 13:11:23 +030084
Mike Frysinger04071c12016-12-28 16:07:16 -050085 <!ELEMENT extend-project EMPTY>
Josh Triplett884a3872014-06-12 14:57:29 -070086 <!ATTLIST extend-project name CDATA #REQUIRED>
87 <!ATTLIST extend-project path CDATA #IMPLIED>
88 <!ATTLIST extend-project groups CDATA #IMPLIED>
89
Mike Frysinger04071c12016-12-28 16:07:16 -050090 <!ELEMENT remove-project EMPTY>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080091 <!ATTLIST remove-project name CDATA #REQUIRED>
Doug Anderson37282b42011-03-04 11:54:18 -080092
Mike Frysinger04071c12016-12-28 16:07:16 -050093 <!ELEMENT repo-hooks EMPTY>
Doug Anderson37282b42011-03-04 11:54:18 -080094 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
95 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Brian Harring26448742011-04-28 05:04:41 -070096
Mike Frysinger04071c12016-12-28 16:07:16 -050097 <!ELEMENT include EMPTY>
Brian Harring26448742011-04-28 05:04:41 -070098 <!ATTLIST include name CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080099 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800100
101A description of the elements and their attributes follows.
102
103
104Element manifest
105----------------
106
107The root element of the file.
108
109
110Element remote
111--------------
112
113One or more remote elements may be specified. Each remote element
114specifies a Git URL shared by one or more projects and (optionally)
115the Gerrit review server those projects upload changes through.
116
117Attribute `name`: A short name unique to this manifest file. The
118name specified here is used as the remote name in each project's
119.git/config, and is therefore automatically available to commands
120like `git fetch`, `git remote`, `git pull` and `git push`.
121
Yestin Sunb292b982012-07-02 07:32:50 -0700122Attribute `alias`: The alias, if specified, is used to override
123`name` to be set as the remote name in each project's .git/config.
124Its value can be duplicated while attribute `name` has to be unique
125in the manifest file. This helps each project to be able to have
126same remote name which actually points to different remote url.
127
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800128Attribute `fetch`: The Git URL prefix for all projects which use
129this remote. Each project's name is appended to this prefix to
130form the actual URL used to clone the project.
131
Steve Raed6480452016-08-10 15:00:00 -0700132Attribute `pushurl`: The Git "push" URL prefix for all projects
133which use this remote. Each project's name is appended to this
134prefix to form the actual URL used to "git push" the project.
135This attribute is optional; if not specified then "git push"
136will use the same URL as the `fetch` attribute.
137
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800138Attribute `review`: Hostname of the Gerrit server where reviews
139are uploaded to by `repo upload`. This attribute is optional;
140if not specified then `repo upload` will not function.
141
Anthony King36ea2fb2014-05-06 11:54:01 +0100142Attribute `revision`: Name of a Git branch (e.g. `master` or
143`refs/heads/master`). Remotes with their own revision will override
144the default revision.
145
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800146Element default
147---------------
148
149At most one default element may be specified. Its remote and
150revision attributes are used when a project element does not
151specify its own remote or revision attribute.
152
153Attribute `remote`: Name of a previously defined remote element.
154Project elements lacking a remote attribute of their own will use
155this remote.
156
157Attribute `revision`: Name of a Git branch (e.g. `master` or
158`refs/heads/master`). Project elements lacking their own
159revision attribute will use this revision.
160
Bryan Jacobsf609f912013-05-06 13:36:24 -0400161Attribute `dest-branch`: Name of a Git branch (e.g. `master`).
162Project elements not setting their own `dest-branch` will inherit
163this value. If this value is not set, projects will use `revision`
164by default instead.
165
Mani Chandel7a91d512014-07-24 16:27:08 +0530166Attribute `sync-j`: Number of parallel jobs to use when synching.
David Pursehouse4e465202012-11-27 22:20:10 +0900167
Mani Chandel7a91d512014-07-24 16:27:08 +0530168Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900169branch (specified in the `revision` attribute) rather than the
Mani Chandel7a91d512014-07-24 16:27:08 +0530170whole ref space. Project elements lacking a sync-c element of
David Pursehouse4e465202012-11-27 22:20:10 +0900171their own will use this value.
172
Mani Chandel7a91d512014-07-24 16:27:08 +0530173Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900174
YOUNG HO CHAa32c92c2018-02-14 16:57:31 +0900175Attribute `sync-tags`: Set to false to only sync the given Git
176branch (specified in the `revision` attribute) rather than
177the other ref tags.
178
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800179
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700180Element manifest-server
181-----------------------
182
183At most one manifest-server may be specified. The url attribute
184is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900185XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700186
David Pursehouse9a27d012012-08-21 14:23:49 +0900187The manifest server should implement the following RPC methods:
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700188
189 GetApprovedManifest(branch, target)
190
David Pursehouse9a27d012012-08-21 14:23:49 +0900191Return a manifest in which each project is pegged to a known good revision
David Pursehousee8688412016-04-13 17:55:34 +0900192for the current branch and target. This is used by repo sync when the
193--smart-sync option is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900194
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700195The target to use is defined by environment variables TARGET_PRODUCT
196and TARGET_BUILD_VARIANT. These variables are used to create a string
197of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
198If one of those variables or both are not present, the program will call
David Pursehousedaa851f2012-08-21 13:52:18 +0900199GetApprovedManifest without the target parameter and the manifest server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700200should choose a reasonable default target.
201
David Pursehouse9a27d012012-08-21 14:23:49 +0900202 GetManifest(tag)
203
204Return a manifest in which each project is pegged to the revision at
David Pursehousee8688412016-04-13 17:55:34 +0900205the specified tag. This is used by repo sync when the --smart-tag option
206is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900207
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700208
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800209Element project
210---------------
211
212One or more project elements may be specified. Each element
213describes a single Git repository to be cloned into the repo
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800214client workspace. You may specify Git-submodules by creating a
215nested project. Git-submodules will be automatically
216recognized and inherit their parent's attributes, but those
217may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800218
219Attribute `name`: A unique name for this project. The project's
220name is appended onto its remote's fetch URL to generate the actual
221URL to configure the Git remote with. The URL gets formed as:
222
223 ${remote_fetch}/${project_name}.git
224
225where ${remote_fetch} is the remote's fetch attribute and
226${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900227is always appended as repo assumes the upstream is a forest of
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800228bare Git repositories. If the project has a parent element, its
229name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800230
231The project name must match the name Gerrit knows, if Gerrit is
232being used for code reviews.
233
234Attribute `path`: An optional path relative to the top directory
235of the repo client where the Git working directory for this project
236should be placed. If not supplied the project name is used.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800237If the project has a parent element, its path will be prefixed
238by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800239
240Attribute `remote`: Name of a previously defined remote element.
241If not supplied the remote given by the default element is used.
242
243Attribute `revision`: Name of the Git branch the manifest wants
244to track for this project. Names can be relative to refs/heads
245(e.g. just "master") or absolute (e.g. "refs/heads/master").
246Tags and/or explicit SHA-1s should work in theory, but have not
247been extensively tested. If not supplied the revision given by
Anthony King36ea2fb2014-05-06 11:54:01 +0100248the remote element is used if applicable, else the default
249element is used.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800250
Bryan Jacobsf609f912013-05-06 13:36:24 -0400251Attribute `dest-branch`: Name of a Git branch (e.g. `master`).
252When using `repo upload`, changes will be submitted for code
253review on this branch. If unspecified both here and in the
254default element, `revision` is used instead.
255
Colin Cross5acde752012-03-28 20:15:45 -0700256Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700257whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700258"all", and each project automatically belongs to a group of
259its name:`name` and path:`path`. E.g. for
Brian Harring7da13142012-06-15 02:24:20 -0700260<project name="monkeys" path="barrel-of"/>, that project
261definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700262default, name:monkeys, and path:barrel-of. If you place a project in the
263group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800264If the project has a parent element, the `name` and `path` here
265are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700266
Mani Chandel7a91d512014-07-24 16:27:08 +0530267Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900268branch (specified in the `revision` attribute) rather than the
269whole ref space.
270
Mani Chandel7a91d512014-07-24 16:27:08 +0530271Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900272
Nasser Grainawi909d58b2014-09-19 12:13:04 -0600273Attribute `upstream`: Name of the Git ref in which a sha1
David Pursehouse4e465202012-11-27 22:20:10 +0900274can be found. Used when syncing a revision locked manifest in
275-c mode to avoid having to sync the entire ref space.
276
David Pursehouseede7f122012-11-27 22:25:30 +0900277Attribute `clone-depth`: Set the depth to use when fetching this
278project. If specified, this value will override any value given
279to repo init with the --depth option on the command line.
280
Scott Fandb83b1b2013-02-28 09:34:14 +0800281Attribute `force-path`: Set to true to force this project to create the
282local mirror repository according to its `path` attribute (if supplied)
283rather than the `name` attribute. This attribute only applies to the
284local mirrors syncing, it will be ignored when syncing the projects in a
285client working directory.
286
Josh Triplett884a3872014-06-12 14:57:29 -0700287Element extend-project
288----------------------
289
290Modify the attributes of the named project.
291
292This element is mostly useful in a local manifest file, to modify the
293attributes of an existing project without completely replacing the
294existing project definition. This makes the local manifest more robust
295against changes to the original manifest.
296
297Attribute `path`: If specified, limit the change to projects checked out
298at the specified path, rather than all projects with the given name.
299
300Attribute `groups`: List of additional groups to which this project
301belongs. Same syntax as the corresponding element of `project`.
302
James W. Mills24c13082012-04-12 15:04:13 -0500303Element annotation
304------------------
305
306Zero or more annotation elements may be specified as children of a
307project element. Each element describes a name-value pair that will be
308exported into each project's environment during a 'forall' command,
309prefixed with REPO__. In addition, there is an optional attribute
310"keep" which accepts the case insensitive values "true" (default) or
311"false". This attribute determines whether or not the annotation will
312be kept when exported with the manifest subcommand.
313
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300314Element copyfile
315----------------
316
317Zero or more copyfile elements may be specified as children of a
318project element. Each element describes a src-dest pair of files;
319the "src" file will be copied to the "dest" place during 'repo sync'
320command.
321"src" is project relative, "dest" is relative to the top of the tree.
322
323Element linkfile
324----------------
325
326It's just like copyfile and runs at the same time as copyfile but
327instead of copying it creates a symlink.
328
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800329Element remove-project
330----------------------
331
332Deletes the named project from the internal manifest table, possibly
333allowing a subsequent project element in the same manifest file to
334replace the project with a different source.
335
David Pursehouseb1525bf2012-11-14 08:51:38 +0900336This element is mostly useful in a local manifest file, where
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800337the user can remove a project, and possibly replace it with their
338own definition.
339
Brian Harring26448742011-04-28 05:04:41 -0700340Element include
341---------------
342
343This element provides the capability of including another manifest
344file into the originating manifest. Normal rules apply for the
David Pursehouse9f3406e2012-11-14 08:52:25 +0900345target manifest to include - it must be a usable manifest on its own.
Brian Harring26448742011-04-28 05:04:41 -0700346
David Pursehouse9f3406e2012-11-14 08:52:25 +0900347Attribute `name`: the manifest to include, specified relative to
348the manifest repository's root.
Brian Harring26448742011-04-28 05:04:41 -0700349
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800350
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900351Local Manifests
352===============
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800353
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900354Additional remotes and projects may be added through local manifest
355files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800356
357For example:
358
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900359 $ ls .repo/local_manifests
360 local_manifest.xml
361 another_local_manifest.xml
362
363 $ cat .repo/local_manifests/local_manifest.xml
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800364 <?xml version="1.0" encoding="UTF-8"?>
365 <manifest>
366 <project path="manifest"
367 name="tools/manifest" />
368 <project path="platform-manifest"
369 name="platform/manifest" />
370 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800371
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900372Users may add projects to the local manifest(s) prior to a `repo sync`
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800373invocation, instructing repo to automatically download and manage
374these extra projects.
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900375
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900376Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
377be loaded in alphabetical order.
378
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900379Additional remotes and projects may also be added through a local
David Pursehouse5566ae52012-11-13 03:04:18 +0900380manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method
381is deprecated in favor of using multiple manifest files as mentioned
382above.
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900383
384If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before
385any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.