blob: 56bdf142f807f8e93fd188e840a66c1f02e73615 [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>
Luis Hector Chavez7d525852018-03-15 09:54:08 -070089 <!ATTLIST extend-project revision CDATA #IMPLIED>
Josh Triplett884a3872014-06-12 14:57:29 -070090
Mike Frysinger04071c12016-12-28 16:07:16 -050091 <!ELEMENT remove-project EMPTY>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080092 <!ATTLIST remove-project name CDATA #REQUIRED>
Doug Anderson37282b42011-03-04 11:54:18 -080093
Mike Frysinger04071c12016-12-28 16:07:16 -050094 <!ELEMENT repo-hooks EMPTY>
Doug Anderson37282b42011-03-04 11:54:18 -080095 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
96 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Brian Harring26448742011-04-28 05:04:41 -070097
Mike Frysinger04071c12016-12-28 16:07:16 -050098 <!ELEMENT include EMPTY>
Brian Harring26448742011-04-28 05:04:41 -070099 <!ATTLIST include name CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800100 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800101
102A description of the elements and their attributes follows.
103
104
105Element manifest
106----------------
107
108The root element of the file.
109
110
111Element remote
112--------------
113
114One or more remote elements may be specified. Each remote element
115specifies a Git URL shared by one or more projects and (optionally)
116the Gerrit review server those projects upload changes through.
117
118Attribute `name`: A short name unique to this manifest file. The
119name specified here is used as the remote name in each project's
120.git/config, and is therefore automatically available to commands
121like `git fetch`, `git remote`, `git pull` and `git push`.
122
Yestin Sunb292b982012-07-02 07:32:50 -0700123Attribute `alias`: The alias, if specified, is used to override
124`name` to be set as the remote name in each project's .git/config.
125Its value can be duplicated while attribute `name` has to be unique
126in the manifest file. This helps each project to be able to have
127same remote name which actually points to different remote url.
128
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800129Attribute `fetch`: The Git URL prefix for all projects which use
130this remote. Each project's name is appended to this prefix to
131form the actual URL used to clone the project.
132
Steve Raed6480452016-08-10 15:00:00 -0700133Attribute `pushurl`: The Git "push" URL prefix for all projects
134which use this remote. Each project's name is appended to this
135prefix to form the actual URL used to "git push" the project.
136This attribute is optional; if not specified then "git push"
137will use the same URL as the `fetch` attribute.
138
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800139Attribute `review`: Hostname of the Gerrit server where reviews
140are uploaded to by `repo upload`. This attribute is optional;
141if not specified then `repo upload` will not function.
142
Anthony King36ea2fb2014-05-06 11:54:01 +0100143Attribute `revision`: Name of a Git branch (e.g. `master` or
144`refs/heads/master`). Remotes with their own revision will override
145the default revision.
146
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800147Element default
148---------------
149
150At most one default element may be specified. Its remote and
151revision attributes are used when a project element does not
152specify its own remote or revision attribute.
153
154Attribute `remote`: Name of a previously defined remote element.
155Project elements lacking a remote attribute of their own will use
156this remote.
157
158Attribute `revision`: Name of a Git branch (e.g. `master` or
159`refs/heads/master`). Project elements lacking their own
160revision attribute will use this revision.
161
Bryan Jacobsf609f912013-05-06 13:36:24 -0400162Attribute `dest-branch`: Name of a Git branch (e.g. `master`).
163Project elements not setting their own `dest-branch` will inherit
164this value. If this value is not set, projects will use `revision`
165by default instead.
166
Mani Chandel7a91d512014-07-24 16:27:08 +0530167Attribute `sync-j`: Number of parallel jobs to use when synching.
David Pursehouse4e465202012-11-27 22:20:10 +0900168
Mani Chandel7a91d512014-07-24 16:27:08 +0530169Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900170branch (specified in the `revision` attribute) rather than the
Mani Chandel7a91d512014-07-24 16:27:08 +0530171whole ref space. Project elements lacking a sync-c element of
David Pursehouse4e465202012-11-27 22:20:10 +0900172their own will use this value.
173
Mani Chandel7a91d512014-07-24 16:27:08 +0530174Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900175
YOUNG HO CHAa32c92c2018-02-14 16:57:31 +0900176Attribute `sync-tags`: Set to false to only sync the given Git
177branch (specified in the `revision` attribute) rather than
178the other ref tags.
179
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800180
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700181Element manifest-server
182-----------------------
183
184At most one manifest-server may be specified. The url attribute
185is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900186XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700187
David Pursehouse9a27d012012-08-21 14:23:49 +0900188The manifest server should implement the following RPC methods:
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700189
190 GetApprovedManifest(branch, target)
191
David Pursehouse9a27d012012-08-21 14:23:49 +0900192Return a manifest in which each project is pegged to a known good revision
David Pursehousee8688412016-04-13 17:55:34 +0900193for the current branch and target. This is used by repo sync when the
194--smart-sync option is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900195
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700196The target to use is defined by environment variables TARGET_PRODUCT
197and TARGET_BUILD_VARIANT. These variables are used to create a string
198of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
199If one of those variables or both are not present, the program will call
David Pursehousedaa851f2012-08-21 13:52:18 +0900200GetApprovedManifest without the target parameter and the manifest server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700201should choose a reasonable default target.
202
David Pursehouse9a27d012012-08-21 14:23:49 +0900203 GetManifest(tag)
204
205Return a manifest in which each project is pegged to the revision at
David Pursehousee8688412016-04-13 17:55:34 +0900206the specified tag. This is used by repo sync when the --smart-tag option
207is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900208
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700209
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800210Element project
211---------------
212
213One or more project elements may be specified. Each element
214describes a single Git repository to be cloned into the repo
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800215client workspace. You may specify Git-submodules by creating a
216nested project. Git-submodules will be automatically
217recognized and inherit their parent's attributes, but those
218may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800219
220Attribute `name`: A unique name for this project. The project's
221name is appended onto its remote's fetch URL to generate the actual
222URL to configure the Git remote with. The URL gets formed as:
223
224 ${remote_fetch}/${project_name}.git
225
226where ${remote_fetch} is the remote's fetch attribute and
227${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900228is always appended as repo assumes the upstream is a forest of
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800229bare Git repositories. If the project has a parent element, its
230name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800231
232The project name must match the name Gerrit knows, if Gerrit is
233being used for code reviews.
234
235Attribute `path`: An optional path relative to the top directory
236of the repo client where the Git working directory for this project
237should be placed. If not supplied the project name is used.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800238If the project has a parent element, its path will be prefixed
239by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800240
241Attribute `remote`: Name of a previously defined remote element.
242If not supplied the remote given by the default element is used.
243
244Attribute `revision`: Name of the Git branch the manifest wants
245to track for this project. Names can be relative to refs/heads
246(e.g. just "master") or absolute (e.g. "refs/heads/master").
247Tags and/or explicit SHA-1s should work in theory, but have not
248been extensively tested. If not supplied the revision given by
Anthony King36ea2fb2014-05-06 11:54:01 +0100249the remote element is used if applicable, else the default
250element is used.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800251
Bryan Jacobsf609f912013-05-06 13:36:24 -0400252Attribute `dest-branch`: Name of a Git branch (e.g. `master`).
253When using `repo upload`, changes will be submitted for code
254review on this branch. If unspecified both here and in the
255default element, `revision` is used instead.
256
Colin Cross5acde752012-03-28 20:15:45 -0700257Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700258whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700259"all", and each project automatically belongs to a group of
260its name:`name` and path:`path`. E.g. for
Brian Harring7da13142012-06-15 02:24:20 -0700261<project name="monkeys" path="barrel-of"/>, that project
262definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700263default, name:monkeys, and path:barrel-of. If you place a project in the
264group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800265If the project has a parent element, the `name` and `path` here
266are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700267
Mani Chandel7a91d512014-07-24 16:27:08 +0530268Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900269branch (specified in the `revision` attribute) rather than the
270whole ref space.
271
Mani Chandel7a91d512014-07-24 16:27:08 +0530272Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900273
Nasser Grainawi909d58b2014-09-19 12:13:04 -0600274Attribute `upstream`: Name of the Git ref in which a sha1
David Pursehouse4e465202012-11-27 22:20:10 +0900275can be found. Used when syncing a revision locked manifest in
276-c mode to avoid having to sync the entire ref space.
277
David Pursehouseede7f122012-11-27 22:25:30 +0900278Attribute `clone-depth`: Set the depth to use when fetching this
279project. If specified, this value will override any value given
280to repo init with the --depth option on the command line.
281
Scott Fandb83b1b2013-02-28 09:34:14 +0800282Attribute `force-path`: Set to true to force this project to create the
283local mirror repository according to its `path` attribute (if supplied)
284rather than the `name` attribute. This attribute only applies to the
285local mirrors syncing, it will be ignored when syncing the projects in a
286client working directory.
287
Josh Triplett884a3872014-06-12 14:57:29 -0700288Element extend-project
289----------------------
290
291Modify the attributes of the named project.
292
293This element is mostly useful in a local manifest file, to modify the
294attributes of an existing project without completely replacing the
295existing project definition. This makes the local manifest more robust
296against changes to the original manifest.
297
298Attribute `path`: If specified, limit the change to projects checked out
299at the specified path, rather than all projects with the given name.
300
301Attribute `groups`: List of additional groups to which this project
302belongs. Same syntax as the corresponding element of `project`.
303
Luis Hector Chavez7d525852018-03-15 09:54:08 -0700304Attribute `revision`: If specified, overrides the revision of the original
305project. Same syntax as the corresponding element of `project`.
306
James W. Mills24c13082012-04-12 15:04:13 -0500307Element annotation
308------------------
309
310Zero or more annotation elements may be specified as children of a
311project element. Each element describes a name-value pair that will be
312exported into each project's environment during a 'forall' command,
313prefixed with REPO__. In addition, there is an optional attribute
314"keep" which accepts the case insensitive values "true" (default) or
315"false". This attribute determines whether or not the annotation will
316be kept when exported with the manifest subcommand.
317
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300318Element copyfile
319----------------
320
321Zero or more copyfile elements may be specified as children of a
322project element. Each element describes a src-dest pair of files;
323the "src" file will be copied to the "dest" place during 'repo sync'
324command.
325"src" is project relative, "dest" is relative to the top of the tree.
326
327Element linkfile
328----------------
329
330It's just like copyfile and runs at the same time as copyfile but
331instead of copying it creates a symlink.
332
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800333Element remove-project
334----------------------
335
336Deletes the named project from the internal manifest table, possibly
337allowing a subsequent project element in the same manifest file to
338replace the project with a different source.
339
David Pursehouseb1525bf2012-11-14 08:51:38 +0900340This element is mostly useful in a local manifest file, where
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800341the user can remove a project, and possibly replace it with their
342own definition.
343
Brian Harring26448742011-04-28 05:04:41 -0700344Element include
345---------------
346
347This element provides the capability of including another manifest
348file into the originating manifest. Normal rules apply for the
David Pursehouse9f3406e2012-11-14 08:52:25 +0900349target manifest to include - it must be a usable manifest on its own.
Brian Harring26448742011-04-28 05:04:41 -0700350
David Pursehouse9f3406e2012-11-14 08:52:25 +0900351Attribute `name`: the manifest to include, specified relative to
352the manifest repository's root.
Brian Harring26448742011-04-28 05:04:41 -0700353
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800354
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900355Local Manifests
356===============
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800357
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900358Additional remotes and projects may be added through local manifest
359files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800360
361For example:
362
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900363 $ ls .repo/local_manifests
364 local_manifest.xml
365 another_local_manifest.xml
366
367 $ cat .repo/local_manifests/local_manifest.xml
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800368 <?xml version="1.0" encoding="UTF-8"?>
369 <manifest>
370 <project path="manifest"
371 name="tools/manifest" />
372 <project path="platform-manifest"
373 name="platform/manifest" />
374 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800375
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900376Users may add projects to the local manifest(s) prior to a `repo sync`
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800377invocation, instructing repo to automatically download and manage
378these extra projects.
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900379
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900380Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
381be loaded in alphabetical order.
382
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900383Additional remotes and projects may also be added through a local
David Pursehouse5566ae52012-11-13 03:04:18 +0900384manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method
385is deprecated in favor of using multiple manifest files as mentioned
386above.
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900387
388If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before
389any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.