blob: 0d26296dafe9742a41e15d539d9d4941e7f43d4a [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<!DOCTYPE manifest [
Mike Frysinger0888a082021-04-13 20:22:01 -040024
Mike Frysinger3891b752018-10-05 19:26:15 -040025 <!ELEMENT manifest (notice?,
26 remote*,
27 default?,
28 manifest-server?,
LaMont Jonescc879a92021-11-18 22:40:18 +000029 submanifest*?,
Mike Frysinger3891b752018-10-05 19:26:15 -040030 remove-project*,
31 project*,
32 extend-project*,
33 repo-hooks?,
Raman Tenneti1bb4fb22021-01-07 16:50:45 -080034 superproject?,
Raman Tenneti1c3f57e2021-05-04 12:32:13 -070035 contactinfo?,
Mike Frysinger3891b752018-10-05 19:26:15 -040036 include*)>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053037
Mike Frysinger3891b752018-10-05 19:26:15 -040038 <!ELEMENT notice (#PCDATA)>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053039
Jack Neus6ea0cae2021-07-20 20:52:33 +000040 <!ELEMENT remote (annotation*)>
Mike Frysinger3891b752018-10-05 19:26:15 -040041 <!ATTLIST remote name ID #REQUIRED>
42 <!ATTLIST remote alias CDATA #IMPLIED>
43 <!ATTLIST remote fetch CDATA #REQUIRED>
44 <!ATTLIST remote pushurl CDATA #IMPLIED>
45 <!ATTLIST remote review CDATA #IMPLIED>
46 <!ATTLIST remote revision CDATA #IMPLIED>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053047
Mike Frysinger3891b752018-10-05 19:26:15 -040048 <!ELEMENT default EMPTY>
49 <!ATTLIST default remote IDREF #IMPLIED>
50 <!ATTLIST default revision CDATA #IMPLIED>
51 <!ATTLIST default dest-branch CDATA #IMPLIED>
52 <!ATTLIST default upstream CDATA #IMPLIED>
53 <!ATTLIST default sync-j CDATA #IMPLIED>
54 <!ATTLIST default sync-c CDATA #IMPLIED>
55 <!ATTLIST default sync-s CDATA #IMPLIED>
56 <!ATTLIST default sync-tags CDATA #IMPLIED>
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070057
Mike Frysinger3891b752018-10-05 19:26:15 -040058 <!ELEMENT manifest-server EMPTY>
59 <!ATTLIST manifest-server url CDATA #REQUIRED>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053060
LaMont Jonescc879a92021-11-18 22:40:18 +000061 <!ELEMENT submanifest EMPTY>
62 <!ATTLIST submanifest name ID #REQUIRED>
63 <!ATTLIST submanifest remote IDREF #IMPLIED>
64 <!ATTLIST submanifest project CDATA #IMPLIED>
65 <!ATTLIST submanifest manifest-name CDATA #IMPLIED>
66 <!ATTLIST submanifest revision CDATA #IMPLIED>
67 <!ATTLIST submanifest path CDATA #IMPLIED>
68 <!ATTLIST submanifest groups CDATA #IMPLIED>
LaMont Jones501733c2022-04-20 16:42:32 +000069 <!ATTLIST submanifest default-groups CDATA #IMPLIED>
LaMont Jonescc879a92021-11-18 22:40:18 +000070
Mike Frysinger3891b752018-10-05 19:26:15 -040071 <!ELEMENT project (annotation*,
72 project*,
73 copyfile*,
74 linkfile*)>
75 <!ATTLIST project name CDATA #REQUIRED>
76 <!ATTLIST project path CDATA #IMPLIED>
77 <!ATTLIST project remote IDREF #IMPLIED>
78 <!ATTLIST project revision CDATA #IMPLIED>
79 <!ATTLIST project dest-branch CDATA #IMPLIED>
80 <!ATTLIST project groups CDATA #IMPLIED>
81 <!ATTLIST project sync-c CDATA #IMPLIED>
82 <!ATTLIST project sync-s CDATA #IMPLIED>
Kyunam Jo01019d92019-03-18 13:30:58 +090083 <!ATTLIST project sync-tags CDATA #IMPLIED>
Mike Frysinger3891b752018-10-05 19:26:15 -040084 <!ATTLIST project upstream CDATA #IMPLIED>
85 <!ATTLIST project clone-depth CDATA #IMPLIED>
86 <!ATTLIST project force-path CDATA #IMPLIED>
James W. Mills24c13082012-04-12 15:04:13 -050087
Mike Frysinger3891b752018-10-05 19:26:15 -040088 <!ELEMENT annotation EMPTY>
89 <!ATTLIST annotation name CDATA #REQUIRED>
90 <!ATTLIST annotation value CDATA #REQUIRED>
91 <!ATTLIST annotation keep CDATA "true">
Chirayu Desaid5a5b192013-11-21 19:15:30 +053092
Mike Frysinger3891b752018-10-05 19:26:15 -040093 <!ELEMENT copyfile EMPTY>
94 <!ATTLIST copyfile src CDATA #REQUIRED>
95 <!ATTLIST copyfile dest CDATA #REQUIRED>
Ruslan Bilovol54527e72015-09-08 13:11:23 +030096
Mike Frysinger3891b752018-10-05 19:26:15 -040097 <!ELEMENT linkfile EMPTY>
98 <!ATTLIST linkfile src CDATA #REQUIRED>
99 <!ATTLIST linkfile dest CDATA #REQUIRED>
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300100
Mike Frysinger3891b752018-10-05 19:26:15 -0400101 <!ELEMENT extend-project EMPTY>
102 <!ATTLIST extend-project name CDATA #REQUIRED>
103 <!ATTLIST extend-project path CDATA #IMPLIED>
Michael Kelly37c21c22020-06-13 02:10:40 -0700104 <!ATTLIST extend-project dest-path CDATA #IMPLIED>
Mike Frysinger3891b752018-10-05 19:26:15 -0400105 <!ATTLIST extend-project groups CDATA #IMPLIED>
106 <!ATTLIST extend-project revision CDATA #IMPLIED>
Kyunam Jobd0aae92020-02-04 11:38:53 +0900107 <!ATTLIST extend-project remote CDATA #IMPLIED>
Josh Triplett884a3872014-06-12 14:57:29 -0700108
Mike Frysinger3891b752018-10-05 19:26:15 -0400109 <!ELEMENT remove-project EMPTY>
110 <!ATTLIST remove-project name CDATA #REQUIRED>
Michael Kelly06da9982021-06-30 01:58:28 -0700111 <!ATTLIST remove-project optional CDATA #IMPLIED>
Doug Anderson37282b42011-03-04 11:54:18 -0800112
Mike Frysinger3891b752018-10-05 19:26:15 -0400113 <!ELEMENT repo-hooks EMPTY>
114 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
115 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Brian Harring26448742011-04-28 05:04:41 -0700116
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700117 <!ELEMENT superproject EMPTY>
Xin Lie0b16a22021-09-26 23:20:32 -0700118 <!ATTLIST superproject name CDATA #REQUIRED>
119 <!ATTLIST superproject remote IDREF #IMPLIED>
120 <!ATTLIST superproject revision CDATA #IMPLIED>
Raman Tenneti1bb4fb22021-01-07 16:50:45 -0800121
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700122 <!ELEMENT contactinfo EMPTY>
123 <!ATTLIST contactinfo bugurl CDATA #REQUIRED>
124
Mike Frysinger3891b752018-10-05 19:26:15 -0400125 <!ELEMENT include EMPTY>
Fredrik de Groot352c93b2020-10-06 12:55:14 +0200126 <!ATTLIST include name CDATA #REQUIRED>
127 <!ATTLIST include groups CDATA #IMPLIED>
Mike Frysinger3891b752018-10-05 19:26:15 -0400128]>
129```
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800130
Raman Tenneti48b2d102021-01-11 12:18:47 -0800131For compatibility purposes across repo releases, all unknown elements are
132silently ignored. However, repo reserves all possible names for itself for
133future use. If you want to use custom elements, the `x-*` namespace is
134reserved for that purpose, and repo guarantees to never allocate any
135corresponding names.
136
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800137A description of the elements and their attributes follows.
138
139
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400140### Element manifest
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800141
142The root element of the file.
143
Mike Frysinger51e39d52020-12-04 05:32:06 -0500144### Element notice
145
146Arbitrary text that is displayed to users whenever `repo sync` finishes.
147The content is simply passed through as it exists in the manifest.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800148
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400149### Element remote
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800150
151One or more remote elements may be specified. Each remote element
152specifies a Git URL shared by one or more projects and (optionally)
153the Gerrit review server those projects upload changes through.
154
155Attribute `name`: A short name unique to this manifest file. The
156name specified here is used as the remote name in each project's
157.git/config, and is therefore automatically available to commands
158like `git fetch`, `git remote`, `git pull` and `git push`.
159
Yestin Sunb292b982012-07-02 07:32:50 -0700160Attribute `alias`: The alias, if specified, is used to override
161`name` to be set as the remote name in each project's .git/config.
162Its value can be duplicated while attribute `name` has to be unique
163in the manifest file. This helps each project to be able to have
164same remote name which actually points to different remote url.
165
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800166Attribute `fetch`: The Git URL prefix for all projects which use
167this remote. Each project's name is appended to this prefix to
168form the actual URL used to clone the project.
169
Steve Raed6480452016-08-10 15:00:00 -0700170Attribute `pushurl`: The Git "push" URL prefix for all projects
171which use this remote. Each project's name is appended to this
172prefix to form the actual URL used to "git push" the project.
173This attribute is optional; if not specified then "git push"
174will use the same URL as the `fetch` attribute.
175
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800176Attribute `review`: Hostname of the Gerrit server where reviews
177are uploaded to by `repo upload`. This attribute is optional;
178if not specified then `repo upload` will not function.
179
Mike Frysinger6e89c962020-11-15 18:42:26 -0500180Attribute `revision`: Name of a Git branch (e.g. `main` or
181`refs/heads/main`). Remotes with their own revision will override
Anthony King36ea2fb2014-05-06 11:54:01 +0100182the default revision.
183
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400184### Element default
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800185
186At most one default element may be specified. Its remote and
187revision attributes are used when a project element does not
188specify its own remote or revision attribute.
189
190Attribute `remote`: Name of a previously defined remote element.
191Project elements lacking a remote attribute of their own will use
192this remote.
193
Mike Frysinger6e89c962020-11-15 18:42:26 -0500194Attribute `revision`: Name of a Git branch (e.g. `main` or
195`refs/heads/main`). Project elements lacking their own
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800196revision attribute will use this revision.
197
Mike Frysinger6e89c962020-11-15 18:42:26 -0500198Attribute `dest-branch`: Name of a Git branch (e.g. `main`).
Bryan Jacobsf609f912013-05-06 13:36:24 -0400199Project elements not setting their own `dest-branch` will inherit
200this value. If this value is not set, projects will use `revision`
201by default instead.
202
Nasser Grainawida403412018-05-04 12:53:29 -0600203Attribute `upstream`: Name of the Git ref in which a sha1
204can be found. Used when syncing a revision locked manifest in
205-c mode to avoid having to sync the entire ref space. Project elements
206not setting their own `upstream` will inherit this value.
207
Mani Chandel7a91d512014-07-24 16:27:08 +0530208Attribute `sync-j`: Number of parallel jobs to use when synching.
David Pursehouse4e465202012-11-27 22:20:10 +0900209
Mani Chandel7a91d512014-07-24 16:27:08 +0530210Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900211branch (specified in the `revision` attribute) rather than the
Mani Chandel7a91d512014-07-24 16:27:08 +0530212whole ref space. Project elements lacking a sync-c element of
David Pursehouse4e465202012-11-27 22:20:10 +0900213their own will use this value.
214
Mani Chandel7a91d512014-07-24 16:27:08 +0530215Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900216
YOUNG HO CHAa32c92c2018-02-14 16:57:31 +0900217Attribute `sync-tags`: Set to false to only sync the given Git
218branch (specified in the `revision` attribute) rather than
219the other ref tags.
220
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800221
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400222### Element manifest-server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700223
224At most one manifest-server may be specified. The url attribute
225is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900226XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700227
David Pursehouse9a27d012012-08-21 14:23:49 +0900228The manifest server should implement the following RPC methods:
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700229
Mike Frysinger3891b752018-10-05 19:26:15 -0400230 GetApprovedManifest(branch, target)
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700231
David Pursehouse9a27d012012-08-21 14:23:49 +0900232Return a manifest in which each project is pegged to a known good revision
David Pursehousee8688412016-04-13 17:55:34 +0900233for the current branch and target. This is used by repo sync when the
234--smart-sync option is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900235
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700236The target to use is defined by environment variables TARGET_PRODUCT
237and TARGET_BUILD_VARIANT. These variables are used to create a string
238of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
239If one of those variables or both are not present, the program will call
David Pursehousedaa851f2012-08-21 13:52:18 +0900240GetApprovedManifest without the target parameter and the manifest server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700241should choose a reasonable default target.
242
Mike Frysinger3891b752018-10-05 19:26:15 -0400243 GetManifest(tag)
David Pursehouse9a27d012012-08-21 14:23:49 +0900244
245Return a manifest in which each project is pegged to the revision at
David Pursehousee8688412016-04-13 17:55:34 +0900246the specified tag. This is used by repo sync when the --smart-tag option
247is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900248
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700249
LaMont Jonescc879a92021-11-18 22:40:18 +0000250### Element submanifest
251
252One or more submanifest elements may be specified. Each element describes a
253single manifest to be checked out as a child.
254
255Attribute `name`: A unique name (within the current (sub)manifest) for this
256submanifest. It acts as a default for `revision` below. The same name can be
257used for submanifests with different parent (sub)manifests.
258
259Attribute `remote`: Name of a previously defined remote element.
260If not supplied the remote given by the default element is used.
261
262Attribute `project`: The manifest project name. The project's name is appended
263onto its remote's fetch URL to generate the actual URL to configure the Git
264remote with. The URL gets formed as:
265
266 ${remote_fetch}/${project_name}.git
267
268where ${remote_fetch} is the remote's fetch attribute and
269${project_name} is the project's name attribute. The suffix ".git"
270is always appended as repo assumes the upstream is a forest of
271bare Git repositories. If the project has a parent element, its
272name will be prefixed by the parent's.
273
274The project name must match the name Gerrit knows, if Gerrit is
275being used for code reviews.
276
277`project` must not be empty, and may not be an absolute path or use "." or ".."
278path components. It is always interpreted relative to the remote's fetch
279settings, so if a different base path is needed, declare a different remote
280with the new settings needed.
281
282If not supplied the remote and project for this manifest will be used: `remote`
283cannot be supplied.
284
LaMont Jonesb308db12022-02-25 17:05:21 +0000285Projects from a submanifest and its submanifests are added to the
286submanifest::path:<path_prefix> group.
287
LaMont Jonescc879a92021-11-18 22:40:18 +0000288Attribute `manifest-name`: The manifest filename in the manifest project. If
289not supplied, `default.xml` is used.
290
291Attribute `revision`: Name of a Git branch (e.g. "main" or "refs/heads/main"),
292tag (e.g. "refs/tags/stable"), or a commit hash. If not supplied, `name` is
293used.
294
295Attribute `path`: An optional path relative to the top directory
296of the repo client where the submanifest repo client top directory
297should be placed. If not supplied, `revision` is used.
298
299`path` may not be an absolute path or use "." or ".." path components.
300
301Attribute `groups`: List of additional groups to which all projects
302in the included submanifest belong. This appends and recurses, meaning
303all projects in submanifests carry all parent submanifest groups.
304Same syntax as the corresponding element of `project`.
305
LaMont Jones501733c2022-04-20 16:42:32 +0000306Attribute `default-groups`: The list of manifest groups to sync if no
307`--groups=` parameter was specified at init. When that list is empty, use this
308list instead of "default" as the list of groups to sync.
LaMont Jonescc879a92021-11-18 22:40:18 +0000309
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400310### Element project
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800311
312One or more project elements may be specified. Each element
313describes a single Git repository to be cloned into the repo
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800314client workspace. You may specify Git-submodules by creating a
315nested project. Git-submodules will be automatically
316recognized and inherit their parent's attributes, but those
317may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800318
319Attribute `name`: A unique name for this project. The project's
320name is appended onto its remote's fetch URL to generate the actual
321URL to configure the Git remote with. The URL gets formed as:
322
Mike Frysinger3891b752018-10-05 19:26:15 -0400323 ${remote_fetch}/${project_name}.git
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800324
325where ${remote_fetch} is the remote's fetch attribute and
326${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900327is always appended as repo assumes the upstream is a forest of
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800328bare Git repositories. If the project has a parent element, its
329name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800330
331The project name must match the name Gerrit knows, if Gerrit is
332being used for code reviews.
333
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500334"name" must not be empty, and may not be an absolute path or use "." or ".."
335path components. It is always interpreted relative to the remote's fetch
336settings, so if a different base path is needed, declare a different remote
337with the new settings needed.
338These restrictions are not enforced for [Local Manifests].
339
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800340Attribute `path`: An optional path relative to the top directory
341of the repo client where the Git working directory for this project
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500342should be placed. If not supplied the project "name" is used.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800343If the project has a parent element, its path will be prefixed
344by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800345
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500346"path" may not be an absolute path or use "." or ".." path components.
347These restrictions are not enforced for [Local Manifests].
348
349If you want to place files into the root of the checkout (e.g. a README or
350Makefile or another build script), use the [copyfile] or [linkfile] elements
351instead.
352
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800353Attribute `remote`: Name of a previously defined remote element.
354If not supplied the remote given by the default element is used.
355
356Attribute `revision`: Name of the Git branch the manifest wants
357to track for this project. Names can be relative to refs/heads
Mike Frysinger6e89c962020-11-15 18:42:26 -0500358(e.g. just "main") or absolute (e.g. "refs/heads/main").
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800359Tags and/or explicit SHA-1s should work in theory, but have not
360been extensively tested. If not supplied the revision given by
Anthony King36ea2fb2014-05-06 11:54:01 +0100361the remote element is used if applicable, else the default
362element is used.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800363
Mike Frysinger6e89c962020-11-15 18:42:26 -0500364Attribute `dest-branch`: Name of a Git branch (e.g. `main`).
Bryan Jacobsf609f912013-05-06 13:36:24 -0400365When using `repo upload`, changes will be submitted for code
366review on this branch. If unspecified both here and in the
367default element, `revision` is used instead.
368
Colin Cross5acde752012-03-28 20:15:45 -0700369Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700370whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700371"all", and each project automatically belongs to a group of
372its name:`name` and path:`path`. E.g. for
Jashank Jeremy97477472020-12-12 20:50:22 +1100373`<project name="monkeys" path="barrel-of"/>`, that project
Brian Harring7da13142012-06-15 02:24:20 -0700374definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700375default, name:monkeys, and path:barrel-of. If you place a project in the
376group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800377If the project has a parent element, the `name` and `path` here
378are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700379
Mani Chandel7a91d512014-07-24 16:27:08 +0530380Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900381branch (specified in the `revision` attribute) rather than the
382whole ref space.
383
Mani Chandel7a91d512014-07-24 16:27:08 +0530384Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900385
Nasser Grainawi909d58b2014-09-19 12:13:04 -0600386Attribute `upstream`: Name of the Git ref in which a sha1
David Pursehouse4e465202012-11-27 22:20:10 +0900387can be found. Used when syncing a revision locked manifest in
388-c mode to avoid having to sync the entire ref space.
389
David Pursehouseede7f122012-11-27 22:25:30 +0900390Attribute `clone-depth`: Set the depth to use when fetching this
391project. If specified, this value will override any value given
392to repo init with the --depth option on the command line.
393
Scott Fandb83b1b2013-02-28 09:34:14 +0800394Attribute `force-path`: Set to true to force this project to create the
395local mirror repository according to its `path` attribute (if supplied)
396rather than the `name` attribute. This attribute only applies to the
397local mirrors syncing, it will be ignored when syncing the projects in a
398client working directory.
399
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400400### Element extend-project
Josh Triplett884a3872014-06-12 14:57:29 -0700401
402Modify the attributes of the named project.
403
404This element is mostly useful in a local manifest file, to modify the
405attributes of an existing project without completely replacing the
406existing project definition. This makes the local manifest more robust
407against changes to the original manifest.
408
409Attribute `path`: If specified, limit the change to projects checked out
410at the specified path, rather than all projects with the given name.
411
Michael Kelly37c21c22020-06-13 02:10:40 -0700412Attribute `dest-path`: If specified, a path relative to the top directory
413of the repo client where the Git working directory for this project
414should be placed. This is used to move a project in the checkout by
415overriding the existing `path` setting.
416
Josh Triplett884a3872014-06-12 14:57:29 -0700417Attribute `groups`: List of additional groups to which this project
418belongs. Same syntax as the corresponding element of `project`.
419
Luis Hector Chavez7d525852018-03-15 09:54:08 -0700420Attribute `revision`: If specified, overrides the revision of the original
421project. Same syntax as the corresponding element of `project`.
422
Kyunam Jobd0aae92020-02-04 11:38:53 +0900423Attribute `remote`: If specified, overrides the remote of the original
424project. Same syntax as the corresponding element of `project`.
425
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400426### Element annotation
James W. Mills24c13082012-04-12 15:04:13 -0500427
428Zero or more annotation elements may be specified as children of a
Jack Neus6ea0cae2021-07-20 20:52:33 +0000429project or remote element. Each element describes a name-value pair.
430For projects, this name-value pair will be exported into each project's
431environment during a 'forall' command, prefixed with `REPO__`. In addition,
432there is an optional attribute "keep" which accepts the case insensitive values
433"true" (default) or "false". This attribute determines whether or not the
434annotation will be kept when exported with the manifest subcommand.
James W. Mills24c13082012-04-12 15:04:13 -0500435
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400436### Element copyfile
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300437
438Zero or more copyfile elements may be specified as children of a
439project element. Each element describes a src-dest pair of files;
Mike Frysinger3891b752018-10-05 19:26:15 -0400440the "src" file will be copied to the "dest" place during `repo sync`
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300441command.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400442
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300443"src" is project relative, "dest" is relative to the top of the tree.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400444Copying from paths outside of the project or to paths outside of the repo
445client is not allowed.
446
447"src" and "dest" must be files. Directories or symlinks are not allowed.
448Intermediate paths must not be symlinks either.
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300449
Mike Frysinger50d27632019-08-01 18:57:10 -0400450Parent directories of "dest" will be automatically created if missing.
451
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400452### Element linkfile
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300453
454It's just like copyfile and runs at the same time as copyfile but
455instead of copying it creates a symlink.
456
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400457The symlink is created at "dest" (relative to the top of the tree) and
Mike Frysinger04122b72019-07-31 23:32:58 -0400458points to the path specified by "src" which is a path in the project.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400459
Mike Frysinger50d27632019-08-01 18:57:10 -0400460Parent directories of "dest" will be automatically created if missing.
461
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400462The symlink target may be a file or directory, but it may not point outside
463of the repo client.
464
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400465### Element remove-project
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800466
467Deletes the named project from the internal manifest table, possibly
468allowing a subsequent project element in the same manifest file to
469replace the project with a different source.
470
David Pursehouseb1525bf2012-11-14 08:51:38 +0900471This element is mostly useful in a local manifest file, where
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800472the user can remove a project, and possibly replace it with their
473own definition.
474
Michael Kelly06da9982021-06-30 01:58:28 -0700475Attribute `optional`: Set to true to ignore remove-project elements with no
476matching `project` element.
477
Mike Frysinger51e39d52020-12-04 05:32:06 -0500478### Element repo-hooks
479
480NB: See the [practical documentation](./repo-hooks.md) for using repo hooks.
481
482Only one repo-hooks element may be specified at a time.
483Attempting to redefine it will fail to parse.
484
485Attribute `in-project`: The project where the hooks are defined. The value
486must match the `name` attribute (**not** the `path` attribute) of a previously
487defined `project` element.
488
489Attribute `enabled-list`: List of hooks to use, whitespace or comma separated.
490
Raman Tenneti1bb4fb22021-01-07 16:50:45 -0800491### Element superproject
492
493***
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700494*Note*: This is currently a WIP.
Raman Tenneti1bb4fb22021-01-07 16:50:45 -0800495***
496
497NB: See the [git superprojects documentation](
498https://en.wikibooks.org/wiki/Git/Submodules_and_Superprojects) for background
499information.
500
501This element is used to specify the URL of the superproject. It has "name" and
502"remote" as atrributes. Only "name" is required while the others have
503reasonable defaults. At most one superproject may be specified.
504Attempting to redefine it will fail to parse.
505
506Attribute `name`: A unique name for the superproject. This attribute has the
507same meaning as project's name attribute. See the
508[element project](#element-project) for more information.
509
510Attribute `remote`: Name of a previously defined remote element.
511If not supplied the remote given by the default element is used.
512
Xin Lie0b16a22021-09-26 23:20:32 -0700513Attribute `revision`: Name of the Git branch the manifest wants
514to track for this superproject. If not supplied the revision given
515by the remote element is used if applicable, else the default
516element is used.
517
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700518### Element contactinfo
519
520***
521*Note*: This is currently a WIP.
522***
523
524This element is used to let manifest authors self-register contact info.
525It has "bugurl" as a required atrribute. This element can be repeated,
526and any later entries will clobber earlier ones. This would allow manifest
527authors who extend manifests to specify their own contact info.
528
529Attribute `bugurl`: The URL to file a bug against the manifest owner.
530
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400531### Element include
Brian Harring26448742011-04-28 05:04:41 -0700532
533This element provides the capability of including another manifest
534file into the originating manifest. Normal rules apply for the
David Pursehouse9f3406e2012-11-14 08:52:25 +0900535target manifest to include - it must be a usable manifest on its own.
Brian Harring26448742011-04-28 05:04:41 -0700536
David Pursehouse9f3406e2012-11-14 08:52:25 +0900537Attribute `name`: the manifest to include, specified relative to
538the manifest repository's root.
Brian Harring26448742011-04-28 05:04:41 -0700539
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500540"name" may not be an absolute path or use "." or ".." path components.
541These restrictions are not enforced for [Local Manifests].
542
Fredrik de Groot352c93b2020-10-06 12:55:14 +0200543Attribute `groups`: List of additional groups to which all projects
544in the included manifest belong. This appends and recurses, meaning
LaMont Jonescc879a92021-11-18 22:40:18 +0000545all projects in included manifests carry all parent include groups.
Fredrik de Groot352c93b2020-10-06 12:55:14 +0200546Same syntax as the corresponding element of `project`.
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800547
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500548## Local Manifests {#local-manifests}
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800549
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900550Additional remotes and projects may be added through local manifest
551files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800552
553For example:
554
Mike Frysinger3891b752018-10-05 19:26:15 -0400555 $ ls .repo/local_manifests
556 local_manifest.xml
557 another_local_manifest.xml
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900558
Mike Frysinger3891b752018-10-05 19:26:15 -0400559 $ cat .repo/local_manifests/local_manifest.xml
560 <?xml version="1.0" encoding="UTF-8"?>
561 <manifest>
562 <project path="manifest"
563 name="tools/manifest" />
564 <project path="platform-manifest"
565 name="platform/manifest" />
566 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800567
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900568Users may add projects to the local manifest(s) prior to a `repo sync`
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800569invocation, instructing repo to automatically download and manage
570these extra projects.
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900571
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900572Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
573be loaded in alphabetical order.
574
Raman Tenneti78f4dd32021-06-07 13:27:37 -0700575Projects from local manifest files are added into
576local::<local manifest filename> group.
577
Mike Frysinger4e1fc102020-09-06 14:42:47 -0400578The legacy `$TOP_DIR/.repo/local_manifest.xml` path is no longer supported.
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500579
580
581[copyfile]: #Element-copyfile
582[linkfile]: #Element-linkfile
583[Local Manifests]: #local-manifests