blob: b439dcb7ba2728c16ce6077cc7371e6269d8040c [file] [log] [blame] [view]
Mike Frysingerb8f7bb02018-10-10 01:05:11 -04001# repo Manifest Format
Shawn O. Pearce3e548192008-11-04 11:19:36 -08002
3A repo manifest describes the structure of a repo client; that is
4the directories that are visible and where they should be obtained
5from with git.
6
7The basic structure of a manifest is a bare Git repository holding
Mike Frysinger3891b752018-10-05 19:26:15 -04008a single `default.xml` XML file in the top level directory.
Shawn O. Pearce3e548192008-11-04 11:19:36 -08009
10Manifests are inherently version controlled, since they are kept
11within a Git repository. Updates to manifests are automatically
12obtained by clients during `repo sync`.
13
Mike Frysinger3891b752018-10-05 19:26:15 -040014[TOC]
15
Shawn O. Pearce3e548192008-11-04 11:19:36 -080016
Mike Frysingerb8f7bb02018-10-10 01:05:11 -040017## XML File Format
Shawn O. Pearce3e548192008-11-04 11:19:36 -080018
Mike Frysinger3891b752018-10-05 19:26:15 -040019A manifest XML file (e.g. `default.xml`) roughly conforms to the
Shawn O. Pearce3e548192008-11-04 11:19:36 -080020following DTD:
21
Mike Frysinger3891b752018-10-05 19:26:15 -040022```xml
23
24
25 remote*,
26 default?,
27 manifest-server?,
28 remove-project*,
29 project*,
30 extend-project*,
31 repo-hooks?,
32 include*)>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053033
Mike Frysinger3891b752018-10-05 19:26:15 -040034
Chirayu Desaid5a5b192013-11-21 19:15:30 +053035
Mike Frysinger3891b752018-10-05 19:26:15 -040036
37
38
39
40
41
42
Chirayu Desaid5a5b192013-11-21 19:15:30 +053043
Mike Frysinger3891b752018-10-05 19:26:15 -040044
45
46
47
48
49
50
51
52
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070053
Mike Frysinger3891b752018-10-05 19:26:15 -040054
55
Chirayu Desaid5a5b192013-11-21 19:15:30 +053056
Mike Frysinger3891b752018-10-05 19:26:15 -040057
58 project*,
59 copyfile*,
60 linkfile*)>
61
62
63
64
65
66
67
68
Kyunam Jo01019d92019-03-18 13:30:58 +090069
Mike Frysinger3891b752018-10-05 19:26:15 -040070
71
72
James W. Mills24c13082012-04-12 15:04:13 -050073
Mike Frysinger3891b752018-10-05 19:26:15 -040074
75
76
77
Chirayu Desaid5a5b192013-11-21 19:15:30 +053078
Mike Frysinger3891b752018-10-05 19:26:15 -040079
80
81
Ruslan Bilovol54527e72015-09-08 13:11:23 +030082
Mike Frysinger3891b752018-10-05 19:26:15 -040083
84
85
Ruslan Bilovol54527e72015-09-08 13:11:23 +030086
Mike Frysinger3891b752018-10-05 19:26:15 -040087
88
89
90
91
Kyunam Jobd0aae92020-02-04 11:38:53 +090092
Josh Triplett884a3872014-06-12 14:57:29 -070093
Mike Frysinger3891b752018-10-05 19:26:15 -040094
95
Doug Anderson37282b42011-03-04 11:54:18 -080096
Mike Frysinger3891b752018-10-05 19:26:15 -040097
98
99
Brian Harring26448742011-04-28 05:04:41 -0700100
Mike Frysinger3891b752018-10-05 19:26:15 -0400101
102
103]>
104```
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800105
106A description of the elements and their attributes follows.
107
108
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400109### Element manifest
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800110
111The root element of the file.
112
113
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400114### Element remote
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800115
116One or more remote elements may be specified. Each remote element
117specifies a Git URL shared by one or more projects and (optionally)
118the Gerrit review server those projects upload changes through.
119
120Attribute `name`: A short name unique to this manifest file. The
121name specified here is used as the remote name in each project's
122.git/config, and is therefore automatically available to commands
123like `git fetch`, `git remote`, `git pull` and `git push`.
124
Yestin Sunb292b982012-07-02 07:32:50 -0700125Attribute `alias`: The alias, if specified, is used to override
126`name` to be set as the remote name in each project's .git/config.
127Its value can be duplicated while attribute `name` has to be unique
128in the manifest file. This helps each project to be able to have
129same remote name which actually points to different remote url.
130
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800131Attribute `fetch`: The Git URL prefix for all projects which use
132this remote. Each project's name is appended to this prefix to
133form the actual URL used to clone the project.
134
Steve Raed6480452016-08-10 15:00:00 -0700135Attribute `pushurl`: The Git "push" URL prefix for all projects
136which use this remote. Each project's name is appended to this
137prefix to form the actual URL used to "git push" the project.
138This attribute is optional; if not specified then "git push"
139will use the same URL as the `fetch` attribute.
140
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800141Attribute `review`: Hostname of the Gerrit server where reviews
142are uploaded to by `repo upload`. This attribute is optional;
143if not specified then `repo upload` will not function.
144
Anthony King36ea2fb2014-05-06 11:54:01 +0100145Attribute `revision`: Name of a Git branch (e.g. `master` or
146`refs/heads/master`). Remotes with their own revision will override
147the default revision.
148
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400149### Element default
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800150
151At most one default element may be specified. Its remote and
152revision attributes are used when a project element does not
153specify its own remote or revision attribute.
154
155Attribute `remote`: Name of a previously defined remote element.
156Project elements lacking a remote attribute of their own will use
157this remote.
158
159Attribute `revision`: Name of a Git branch (e.g. `master` or
160`refs/heads/master`). Project elements lacking their own
161revision attribute will use this revision.
162
Bryan Jacobsf609f912013-05-06 13:36:24 -0400163Attribute `dest-branch`: Name of a Git branch (e.g. `master`).
164Project elements not setting their own `dest-branch` will inherit
165this value. If this value is not set, projects will use `revision`
166by default instead.
167
Nasser Grainawida403412018-05-04 12:53:29 -0600168Attribute `upstream`: Name of the Git ref in which a sha1
169can be found. Used when syncing a revision locked manifest in
170-c mode to avoid having to sync the entire ref space. Project elements
171not setting their own `upstream` will inherit this value.
172
Mani Chandel7a91d512014-07-24 16:27:08 +0530173Attribute `sync-j`: Number of parallel jobs to use when synching.
David Pursehouse4e465202012-11-27 22:20:10 +0900174
Mani Chandel7a91d512014-07-24 16:27:08 +0530175Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900176branch (specified in the `revision` attribute) rather than the
Mani Chandel7a91d512014-07-24 16:27:08 +0530177whole ref space. Project elements lacking a sync-c element of
David Pursehouse4e465202012-11-27 22:20:10 +0900178their own will use this value.
179
Mani Chandel7a91d512014-07-24 16:27:08 +0530180Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900181
YOUNG HO CHAa32c92c2018-02-14 16:57:31 +0900182Attribute `sync-tags`: Set to false to only sync the given Git
183branch (specified in the `revision` attribute) rather than
184the other ref tags.
185
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800186
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400187### Element manifest-server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700188
189At most one manifest-server may be specified. The url attribute
190is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900191XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700192
David Pursehouse9a27d012012-08-21 14:23:49 +0900193The manifest server should implement the following RPC methods:
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700194
Mike Frysinger3891b752018-10-05 19:26:15 -0400195 GetApprovedManifest(branch, target)
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700196
David Pursehouse9a27d012012-08-21 14:23:49 +0900197Return a manifest in which each project is pegged to a known good revision
David Pursehousee8688412016-04-13 17:55:34 +0900198for the current branch and target. This is used by repo sync when the
199--smart-sync option is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900200
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700201The target to use is defined by environment variables TARGET_PRODUCT
202and TARGET_BUILD_VARIANT. These variables are used to create a string
203of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
204If one of those variables or both are not present, the program will call
David Pursehousedaa851f2012-08-21 13:52:18 +0900205GetApprovedManifest without the target parameter and the manifest server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700206should choose a reasonable default target.
207
Mike Frysinger3891b752018-10-05 19:26:15 -0400208 GetManifest(tag)
David Pursehouse9a27d012012-08-21 14:23:49 +0900209
210Return a manifest in which each project is pegged to the revision at
David Pursehousee8688412016-04-13 17:55:34 +0900211the specified tag. This is used by repo sync when the --smart-tag option
212is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900213
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700214
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400215### Element project
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800216
217One or more project elements may be specified. Each element
218describes a single Git repository to be cloned into the repo
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800219client workspace. You may specify Git-submodules by creating a
220nested project. Git-submodules will be automatically
221recognized and inherit their parent's attributes, but those
222may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800223
224Attribute `name`: A unique name for this project. The project's
225name is appended onto its remote's fetch URL to generate the actual
226URL to configure the Git remote with. The URL gets formed as:
227
Mike Frysinger3891b752018-10-05 19:26:15 -0400228 ${remote_fetch}/${project_name}.git
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800229
230where ${remote_fetch} is the remote's fetch attribute and
231${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900232is always appended as repo assumes the upstream is a forest of
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800233bare Git repositories. If the project has a parent element, its
234name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800235
236The project name must match the name Gerrit knows, if Gerrit is
237being used for code reviews.
238
239Attribute `path`: An optional path relative to the top directory
240of the repo client where the Git working directory for this project
241should be placed. If not supplied the project name is used.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800242If the project has a parent element, its path will be prefixed
243by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800244
245Attribute `remote`: Name of a previously defined remote element.
246If not supplied the remote given by the default element is used.
247
248Attribute `revision`: Name of the Git branch the manifest wants
249to track for this project. Names can be relative to refs/heads
250(e.g. just "master") or absolute (e.g. "refs/heads/master").
251Tags and/or explicit SHA-1s should work in theory, but have not
252been extensively tested. If not supplied the revision given by
Anthony King36ea2fb2014-05-06 11:54:01 +0100253the remote element is used if applicable, else the default
254element is used.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800255
Bryan Jacobsf609f912013-05-06 13:36:24 -0400256Attribute `dest-branch`: Name of a Git branch (e.g. `master`).
257When using `repo upload`, changes will be submitted for code
258review on this branch. If unspecified both here and in the
259default element, `revision` is used instead.
260
Colin Cross5acde752012-03-28 20:15:45 -0700261Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700262whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700263"all", and each project automatically belongs to a group of
264its name:`name` and path:`path`. E.g. for
Brian Harring7da13142012-06-15 02:24:20 -0700265, that project
266definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700267default, name:monkeys, and path:barrel-of. If you place a project in the
268group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800269If the project has a parent element, the `name` and `path` here
270are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700271
Mani Chandel7a91d512014-07-24 16:27:08 +0530272Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900273branch (specified in the `revision` attribute) rather than the
274whole ref space.
275
Mani Chandel7a91d512014-07-24 16:27:08 +0530276Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900277
Nasser Grainawi909d58b2014-09-19 12:13:04 -0600278Attribute `upstream`: Name of the Git ref in which a sha1
David Pursehouse4e465202012-11-27 22:20:10 +0900279can be found. Used when syncing a revision locked manifest in
280-c mode to avoid having to sync the entire ref space.
281
David Pursehouseede7f122012-11-27 22:25:30 +0900282Attribute `clone-depth`: Set the depth to use when fetching this
283project. If specified, this value will override any value given
284to repo init with the --depth option on the command line.
285
Scott Fandb83b1b2013-02-28 09:34:14 +0800286Attribute `force-path`: Set to true to force this project to create the
287local mirror repository according to its `path` attribute (if supplied)
288rather than the `name` attribute. This attribute only applies to the
289local mirrors syncing, it will be ignored when syncing the projects in a
290client working directory.
291
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400292### Element extend-project
Josh Triplett884a3872014-06-12 14:57:29 -0700293
294Modify the attributes of the named project.
295
296This element is mostly useful in a local manifest file, to modify the
297attributes of an existing project without completely replacing the
298existing project definition. This makes the local manifest more robust
299against changes to the original manifest.
300
301Attribute `path`: If specified, limit the change to projects checked out
302at the specified path, rather than all projects with the given name.
303
304Attribute `groups`: List of additional groups to which this project
305belongs. Same syntax as the corresponding element of `project`.
306
Luis Hector Chavez7d525852018-03-15 09:54:08 -0700307Attribute `revision`: If specified, overrides the revision of the original
308project. Same syntax as the corresponding element of `project`.
309
Kyunam Jobd0aae92020-02-04 11:38:53 +0900310Attribute `remote`: If specified, overrides the remote of the original
311project. Same syntax as the corresponding element of `project`.
312
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400313### Element annotation
James W. Mills24c13082012-04-12 15:04:13 -0500314
315Zero or more annotation elements may be specified as children of a
316project element. Each element describes a name-value pair that will be
317exported into each project's environment during a 'forall' command,
318prefixed with REPO__. In addition, there is an optional attribute
319"keep" which accepts the case insensitive values "true" (default) or
320"false". This attribute determines whether or not the annotation will
321be kept when exported with the manifest subcommand.
322
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400323### Element copyfile
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300324
325Zero or more copyfile elements may be specified as children of a
326project element. Each element describes a src-dest pair of files;
Mike Frysinger3891b752018-10-05 19:26:15 -0400327the "src" file will be copied to the "dest" place during `repo sync`
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300328command.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400329
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300330"src" is project relative, "dest" is relative to the top of the tree.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400331Copying from paths outside of the project or to paths outside of the repo
332client is not allowed.
333
334"src" and "dest" must be files. Directories or symlinks are not allowed.
335Intermediate paths must not be symlinks either.
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300336
Mike Frysinger50d27632019-08-01 18:57:10 -0400337Parent directories of "dest" will be automatically created if missing.
338
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400339### Element linkfile
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300340
341It's just like copyfile and runs at the same time as copyfile but
342instead of copying it creates a symlink.
343
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400344The symlink is created at "dest" (relative to the top of the tree) and
Mike Frysinger04122b72019-07-31 23:32:58 -0400345points to the path specified by "src" which is a path in the project.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400346
Mike Frysinger50d27632019-08-01 18:57:10 -0400347Parent directories of "dest" will be automatically created if missing.
348
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400349The symlink target may be a file or directory, but it may not point outside
350of the repo client.
351
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400352### Element remove-project
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800353
354Deletes the named project from the internal manifest table, possibly
355allowing a subsequent project element in the same manifest file to
356replace the project with a different source.
357
David Pursehouseb1525bf2012-11-14 08:51:38 +0900358This element is mostly useful in a local manifest file, where
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800359the user can remove a project, and possibly replace it with their
360own definition.
361
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400362### Element include
Brian Harring26448742011-04-28 05:04:41 -0700363
364This element provides the capability of including another manifest
365file into the originating manifest. Normal rules apply for the
David Pursehouse9f3406e2012-11-14 08:52:25 +0900366target manifest to include - it must be a usable manifest on its own.
Brian Harring26448742011-04-28 05:04:41 -0700367
David Pursehouse9f3406e2012-11-14 08:52:25 +0900368Attribute `name`: the manifest to include, specified relative to
369the manifest repository's root.
Brian Harring26448742011-04-28 05:04:41 -0700370
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800371
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400372## Local Manifests
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800373
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900374Additional remotes and projects may be added through local manifest
375files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800376
377For example:
378
Mike Frysinger3891b752018-10-05 19:26:15 -0400379 $ ls .repo/local_manifests
380 local_manifest.xml
381 another_local_manifest.xml
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900382
Mike Frysinger3891b752018-10-05 19:26:15 -0400383 $ cat .repo/local_manifests/local_manifest.xml
384
385
386
387 name="tools/manifest" />
388
389 name="platform/manifest" />
390
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800391
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900392Users may add projects to the local manifest(s) prior to a `repo sync`
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800393invocation, instructing repo to automatically download and manage
394these extra projects.
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900395
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900396Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
397be loaded in alphabetical order.
398
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900399Additional remotes and projects may also be added through a local
David Pursehouse5566ae52012-11-13 03:04:18 +0900400manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method
401is deprecated in favor of using multiple manifest files as mentioned
402above.
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900403
404If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before
405any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.