blob: cfb8016434fd27e3ba008ab411f21c8694d73d00 [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>
Erik Elmeke4cdfdb72022-09-09 17:13:17 +0200108 <!ATTLIST extend-project dest-branch CDATA #IMPLIED>
109 <!ATTLIST extend-project upstream CDATA #IMPLIED>
Fredrik de Groot303bd962024-09-09 15:54:57 +0200110 <!ATTLIST extend-project base-rev CDATA #IMPLIED>
Josh Triplett884a3872014-06-12 14:57:29 -0700111
Mike Frysinger3891b752018-10-05 19:26:15 -0400112 <!ELEMENT remove-project EMPTY>
Fredrik de Grootbe71c2f2023-05-31 16:56:34 +0200113 <!ATTLIST remove-project name CDATA #IMPLIED>
114 <!ATTLIST remove-project path CDATA #IMPLIED>
115 <!ATTLIST remove-project optional CDATA #IMPLIED>
Fredrik de Groot303bd962024-09-09 15:54:57 +0200116 <!ATTLIST remove-project base-rev CDATA #IMPLIED>
Doug Anderson37282b42011-03-04 11:54:18 -0800117
Mike Frysinger3891b752018-10-05 19:26:15 -0400118 <!ELEMENT repo-hooks EMPTY>
119 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
120 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Brian Harring26448742011-04-28 05:04:41 -0700121
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700122 <!ELEMENT superproject EMPTY>
Xin Lie0b16a22021-09-26 23:20:32 -0700123 <!ATTLIST superproject name CDATA #REQUIRED>
124 <!ATTLIST superproject remote IDREF #IMPLIED>
125 <!ATTLIST superproject revision CDATA #IMPLIED>
Raman Tenneti1bb4fb22021-01-07 16:50:45 -0800126
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700127 <!ELEMENT contactinfo EMPTY>
128 <!ATTLIST contactinfo bugurl CDATA #REQUIRED>
129
Mike Frysinger3891b752018-10-05 19:26:15 -0400130 <!ELEMENT include EMPTY>
Shuchuan Zeng3e3340d2023-04-18 10:36:50 +0800131 <!ATTLIST include name CDATA #REQUIRED>
132 <!ATTLIST include groups CDATA #IMPLIED>
133 <!ATTLIST include revision CDATA #IMPLIED>
Mike Frysinger3891b752018-10-05 19:26:15 -0400134]>
135```
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800136
Raman Tenneti48b2d102021-01-11 12:18:47 -0800137For compatibility purposes across repo releases, all unknown elements are
138silently ignored. However, repo reserves all possible names for itself for
139future use. If you want to use custom elements, the `x-*` namespace is
140reserved for that purpose, and repo guarantees to never allocate any
141corresponding names.
142
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800143A description of the elements and their attributes follows.
144
145
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400146### Element manifest
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800147
148The root element of the file.
149
Mike Frysinger51e39d52020-12-04 05:32:06 -0500150### Element notice
151
152Arbitrary text that is displayed to users whenever `repo sync` finishes.
153The content is simply passed through as it exists in the manifest.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800154
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400155### Element remote
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800156
157One or more remote elements may be specified. Each remote element
158specifies a Git URL shared by one or more projects and (optionally)
159the Gerrit review server those projects upload changes through.
160
161Attribute `name`: A short name unique to this manifest file. The
162name specified here is used as the remote name in each project's
163.git/config, and is therefore automatically available to commands
164like `git fetch`, `git remote`, `git pull` and `git push`.
165
Yestin Sunb292b982012-07-02 07:32:50 -0700166Attribute `alias`: The alias, if specified, is used to override
167`name` to be set as the remote name in each project's .git/config.
168Its value can be duplicated while attribute `name` has to be unique
169in the manifest file. This helps each project to be able to have
170same remote name which actually points to different remote url.
171
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800172Attribute `fetch`: The Git URL prefix for all projects which use
173this remote. Each project's name is appended to this prefix to
174form the actual URL used to clone the project.
175
Steve Raed6480452016-08-10 15:00:00 -0700176Attribute `pushurl`: The Git "push" URL prefix for all projects
177which use this remote. Each project's name is appended to this
178prefix to form the actual URL used to "git push" the project.
179This attribute is optional; if not specified then "git push"
180will use the same URL as the `fetch` attribute.
181
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800182Attribute `review`: Hostname of the Gerrit server where reviews
183are uploaded to by `repo upload`. This attribute is optional;
184if not specified then `repo upload` will not function.
185
Mike Frysinger6e89c962020-11-15 18:42:26 -0500186Attribute `revision`: Name of a Git branch (e.g. `main` or
187`refs/heads/main`). Remotes with their own revision will override
Anthony King36ea2fb2014-05-06 11:54:01 +0100188the default revision.
189
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400190### Element default
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800191
192At most one default element may be specified. Its remote and
193revision attributes are used when a project element does not
194specify its own remote or revision attribute.
195
196Attribute `remote`: Name of a previously defined remote element.
197Project elements lacking a remote attribute of their own will use
198this remote.
199
Mike Frysinger6e89c962020-11-15 18:42:26 -0500200Attribute `revision`: Name of a Git branch (e.g. `main` or
201`refs/heads/main`). Project elements lacking their own
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800202revision attribute will use this revision.
203
Mike Frysinger6e89c962020-11-15 18:42:26 -0500204Attribute `dest-branch`: Name of a Git branch (e.g. `main`).
Bryan Jacobsf609f912013-05-06 13:36:24 -0400205Project elements not setting their own `dest-branch` will inherit
206this value. If this value is not set, projects will use `revision`
207by default instead.
208
Nasser Grainawida403412018-05-04 12:53:29 -0600209Attribute `upstream`: Name of the Git ref in which a sha1
210can be found. Used when syncing a revision locked manifest in
211-c mode to avoid having to sync the entire ref space. Project elements
212not setting their own `upstream` will inherit this value.
213
Mani Chandel7a91d512014-07-24 16:27:08 +0530214Attribute `sync-j`: Number of parallel jobs to use when synching.
David Pursehouse4e465202012-11-27 22:20:10 +0900215
Mani Chandel7a91d512014-07-24 16:27:08 +0530216Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900217branch (specified in the `revision` attribute) rather than the
Mani Chandel7a91d512014-07-24 16:27:08 +0530218whole ref space. Project elements lacking a sync-c element of
David Pursehouse4e465202012-11-27 22:20:10 +0900219their own will use this value.
220
Mani Chandel7a91d512014-07-24 16:27:08 +0530221Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900222
YOUNG HO CHAa32c92c2018-02-14 16:57:31 +0900223Attribute `sync-tags`: Set to false to only sync the given Git
224branch (specified in the `revision` attribute) rather than
225the other ref tags.
226
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800227
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400228### Element manifest-server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700229
230At most one manifest-server may be specified. The url attribute
231is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900232XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700233
David Pursehouse9a27d012012-08-21 14:23:49 +0900234The manifest server should implement the following RPC methods:
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700235
Mike Frysinger3891b752018-10-05 19:26:15 -0400236 GetApprovedManifest(branch, target)
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700237
David Pursehouse9a27d012012-08-21 14:23:49 +0900238Return a manifest in which each project is pegged to a known good revision
David Pursehousee8688412016-04-13 17:55:34 +0900239for the current branch and target. This is used by repo sync when the
240--smart-sync option is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900241
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700242The target to use is defined by environment variables TARGET_PRODUCT
243and TARGET_BUILD_VARIANT. These variables are used to create a string
244of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
245If one of those variables or both are not present, the program will call
David Pursehousedaa851f2012-08-21 13:52:18 +0900246GetApprovedManifest without the target parameter and the manifest server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700247should choose a reasonable default target.
248
Mike Frysinger3891b752018-10-05 19:26:15 -0400249 GetManifest(tag)
David Pursehouse9a27d012012-08-21 14:23:49 +0900250
251Return a manifest in which each project is pegged to the revision at
David Pursehousee8688412016-04-13 17:55:34 +0900252the specified tag. This is used by repo sync when the --smart-tag option
253is given.
David Pursehouse9a27d012012-08-21 14:23:49 +0900254
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700255
LaMont Jonescc879a92021-11-18 22:40:18 +0000256### Element submanifest
257
258One or more submanifest elements may be specified. Each element describes a
259single manifest to be checked out as a child.
260
261Attribute `name`: A unique name (within the current (sub)manifest) for this
262submanifest. It acts as a default for `revision` below. The same name can be
263used for submanifests with different parent (sub)manifests.
264
265Attribute `remote`: Name of a previously defined remote element.
266If not supplied the remote given by the default element is used.
267
268Attribute `project`: The manifest project name. The project's name is appended
269onto its remote's fetch URL to generate the actual URL to configure the Git
270remote with. The URL gets formed as:
271
272 ${remote_fetch}/${project_name}.git
273
274where ${remote_fetch} is the remote's fetch attribute and
275${project_name} is the project's name attribute. The suffix ".git"
276is always appended as repo assumes the upstream is a forest of
277bare Git repositories. If the project has a parent element, its
278name will be prefixed by the parent's.
279
280The project name must match the name Gerrit knows, if Gerrit is
281being used for code reviews.
282
283`project` must not be empty, and may not be an absolute path or use "." or ".."
284path components. It is always interpreted relative to the remote's fetch
285settings, so if a different base path is needed, declare a different remote
286with the new settings needed.
287
288If not supplied the remote and project for this manifest will be used: `remote`
289cannot be supplied.
290
LaMont Jonesb308db12022-02-25 17:05:21 +0000291Projects from a submanifest and its submanifests are added to the
292submanifest::path:<path_prefix> group.
293
LaMont Jonescc879a92021-11-18 22:40:18 +0000294Attribute `manifest-name`: The manifest filename in the manifest project. If
295not supplied, `default.xml` is used.
296
297Attribute `revision`: Name of a Git branch (e.g. "main" or "refs/heads/main"),
298tag (e.g. "refs/tags/stable"), or a commit hash. If not supplied, `name` is
299used.
300
301Attribute `path`: An optional path relative to the top directory
302of the repo client where the submanifest repo client top directory
303should be placed. If not supplied, `revision` is used.
304
305`path` may not be an absolute path or use "." or ".." path components.
306
307Attribute `groups`: List of additional groups to which all projects
308in the included submanifest belong. This appends and recurses, meaning
309all projects in submanifests carry all parent submanifest groups.
310Same syntax as the corresponding element of `project`.
311
LaMont Jones501733c2022-04-20 16:42:32 +0000312Attribute `default-groups`: The list of manifest groups to sync if no
313`--groups=` parameter was specified at init. When that list is empty, use this
314list instead of "default" as the list of groups to sync.
LaMont Jonescc879a92021-11-18 22:40:18 +0000315
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400316### Element project
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800317
318One or more project elements may be specified. Each element
319describes a single Git repository to be cloned into the repo
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800320client workspace. You may specify Git-submodules by creating a
321nested project. Git-submodules will be automatically
322recognized and inherit their parent's attributes, but those
323may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800324
325Attribute `name`: A unique name for this project. The project's
326name is appended onto its remote's fetch URL to generate the actual
327URL to configure the Git remote with. The URL gets formed as:
328
Mike Frysinger3891b752018-10-05 19:26:15 -0400329 ${remote_fetch}/${project_name}.git
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800330
331where ${remote_fetch} is the remote's fetch attribute and
332${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900333is always appended as repo assumes the upstream is a forest of
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800334bare Git repositories. If the project has a parent element, its
335name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800336
337The project name must match the name Gerrit knows, if Gerrit is
338being used for code reviews.
339
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500340"name" must not be empty, and may not be an absolute path or use "." or ".."
341path components. It is always interpreted relative to the remote's fetch
342settings, so if a different base path is needed, declare a different remote
343with the new settings needed.
344These restrictions are not enforced for [Local Manifests].
345
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800346Attribute `path`: An optional path relative to the top directory
347of the repo client where the Git working directory for this project
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500348should be placed. If not supplied the project "name" is used.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800349If the project has a parent element, its path will be prefixed
350by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800351
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500352"path" may not be an absolute path or use "." or ".." path components.
353These restrictions are not enforced for [Local Manifests].
354
355If you want to place files into the root of the checkout (e.g. a README or
356Makefile or another build script), use the [copyfile] or [linkfile] elements
357instead.
358
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800359Attribute `remote`: Name of a previously defined remote element.
360If not supplied the remote given by the default element is used.
361
362Attribute `revision`: Name of the Git branch the manifest wants
363to track for this project. Names can be relative to refs/heads
Mike Frysinger6e89c962020-11-15 18:42:26 -0500364(e.g. just "main") or absolute (e.g. "refs/heads/main").
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800365Tags and/or explicit SHA-1s should work in theory, but have not
366been extensively tested. If not supplied the revision given by
Anthony King36ea2fb2014-05-06 11:54:01 +0100367the remote element is used if applicable, else the default
368element is used.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800369
Mike Frysinger6e89c962020-11-15 18:42:26 -0500370Attribute `dest-branch`: Name of a Git branch (e.g. `main`).
Bryan Jacobsf609f912013-05-06 13:36:24 -0400371When using `repo upload`, changes will be submitted for code
372review on this branch. If unspecified both here and in the
373default element, `revision` is used instead.
374
Colin Cross5acde752012-03-28 20:15:45 -0700375Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700376whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700377"all", and each project automatically belongs to a group of
378its name:`name` and path:`path`. E.g. for
Jashank Jeremy97477472020-12-12 20:50:22 +1100379`<project name="monkeys" path="barrel-of"/>`, that project
Brian Harring7da13142012-06-15 02:24:20 -0700380definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700381default, name:monkeys, and path:barrel-of. If you place a project in the
382group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800383If the project has a parent element, the `name` and `path` here
384are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700385
Mani Chandel7a91d512014-07-24 16:27:08 +0530386Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900387branch (specified in the `revision` attribute) rather than the
388whole ref space.
389
Mani Chandel7a91d512014-07-24 16:27:08 +0530390Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900391
Nasser Grainawi909d58b2014-09-19 12:13:04 -0600392Attribute `upstream`: Name of the Git ref in which a sha1
David Pursehouse4e465202012-11-27 22:20:10 +0900393can be found. Used when syncing a revision locked manifest in
394-c mode to avoid having to sync the entire ref space.
395
David Pursehouseede7f122012-11-27 22:25:30 +0900396Attribute `clone-depth`: Set the depth to use when fetching this
397project. If specified, this value will override any value given
398to repo init with the --depth option on the command line.
399
Scott Fandb83b1b2013-02-28 09:34:14 +0800400Attribute `force-path`: Set to true to force this project to create the
401local mirror repository according to its `path` attribute (if supplied)
402rather than the `name` attribute. This attribute only applies to the
403local mirrors syncing, it will be ignored when syncing the projects in a
404client working directory.
405
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400406### Element extend-project
Josh Triplett884a3872014-06-12 14:57:29 -0700407
408Modify the attributes of the named project.
409
410This element is mostly useful in a local manifest file, to modify the
411attributes of an existing project without completely replacing the
412existing project definition. This makes the local manifest more robust
413against changes to the original manifest.
414
415Attribute `path`: If specified, limit the change to projects checked out
416at the specified path, rather than all projects with the given name.
417
Michael Kelly37c21c22020-06-13 02:10:40 -0700418Attribute `dest-path`: If specified, a path relative to the top directory
419of the repo client where the Git working directory for this project
420should be placed. This is used to move a project in the checkout by
421overriding the existing `path` setting.
422
Josh Triplett884a3872014-06-12 14:57:29 -0700423Attribute `groups`: List of additional groups to which this project
424belongs. Same syntax as the corresponding element of `project`.
425
Luis Hector Chavez7d525852018-03-15 09:54:08 -0700426Attribute `revision`: If specified, overrides the revision of the original
427project. Same syntax as the corresponding element of `project`.
428
Kyunam Jobd0aae92020-02-04 11:38:53 +0900429Attribute `remote`: If specified, overrides the remote of the original
430project. Same syntax as the corresponding element of `project`.
431
Erik Elmeke4cdfdb72022-09-09 17:13:17 +0200432Attribute `dest-branch`: If specified, overrides the dest-branch of the original
433project. Same syntax as the corresponding element of `project`.
434
435Attribute `upstream`: If specified, overrides the upstream of the original
436project. Same syntax as the corresponding element of `project`.
437
Fredrik de Groot303bd962024-09-09 15:54:57 +0200438Attribute `base-rev`: If specified, adds a check against the revision
439to be extended. Manifest parse will fail and give a list of mismatch extends
440if the revisions being extended have changed since base-rev was set.
441Intended for use with layered manifests using hash revisions to prevent
442patch branches hiding newer upstream revisions. Also compares named refs
443like branches or tags but is misleading if branches are used as base-rev.
444Same syntax as the corresponding element of `project`.
445
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400446### Element annotation
James W. Mills24c13082012-04-12 15:04:13 -0500447
448Zero or more annotation elements may be specified as children of a
Jack Neus6ea0cae2021-07-20 20:52:33 +0000449project or remote element. Each element describes a name-value pair.
450For projects, this name-value pair will be exported into each project's
451environment during a 'forall' command, prefixed with `REPO__`. In addition,
452there is an optional attribute "keep" which accepts the case insensitive values
453"true" (default) or "false". This attribute determines whether or not the
454annotation will be kept when exported with the manifest subcommand.
James W. Mills24c13082012-04-12 15:04:13 -0500455
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400456### Element copyfile
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300457
458Zero or more copyfile elements may be specified as children of a
459project element. Each element describes a src-dest pair of files;
Mike Frysinger3891b752018-10-05 19:26:15 -0400460the "src" file will be copied to the "dest" place during `repo sync`
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300461command.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400462
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300463"src" is project relative, "dest" is relative to the top of the tree.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400464Copying from paths outside of the project or to paths outside of the repo
465client is not allowed.
466
467"src" and "dest" must be files. Directories or symlinks are not allowed.
468Intermediate paths must not be symlinks either.
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300469
Mike Frysinger50d27632019-08-01 18:57:10 -0400470Parent directories of "dest" will be automatically created if missing.
471
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400472### Element linkfile
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300473
474It's just like copyfile and runs at the same time as copyfile but
475instead of copying it creates a symlink.
476
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400477The symlink is created at "dest" (relative to the top of the tree) and
Mike Frysinger04122b72019-07-31 23:32:58 -0400478points to the path specified by "src" which is a path in the project.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400479
Mike Frysinger50d27632019-08-01 18:57:10 -0400480Parent directories of "dest" will be automatically created if missing.
481
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400482The symlink target may be a file or directory, but it may not point outside
483of the repo client.
484
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400485### Element remove-project
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800486
Fredrik de Grootbe71c2f2023-05-31 16:56:34 +0200487Deletes a project from the internal manifest table, possibly
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800488allowing a subsequent project element in the same manifest file to
489replace the project with a different source.
490
David Pursehouseb1525bf2012-11-14 08:51:38 +0900491This element is mostly useful in a local manifest file, where
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800492the user can remove a project, and possibly replace it with their
493own definition.
494
Fredrik de Grootbe71c2f2023-05-31 16:56:34 +0200495The project `name` or project `path` can be used to specify the remove target
496meaning one of them is required. If only name is specified, all
497projects with that name are removed.
498
499If both name and path are specified, only projects with the same name and
500path are removed, meaning projects with the same name but in other
501locations are kept.
502
503If only path is specified, a matching project is removed regardless of its
504name. Logic otherwise behaves like both are specified.
505
Michael Kelly06da9982021-06-30 01:58:28 -0700506Attribute `optional`: Set to true to ignore remove-project elements with no
507matching `project` element.
508
Fredrik de Groot303bd962024-09-09 15:54:57 +0200509Attribute `base-rev`: If specified, adds a check against the revision
510to be removed. Manifest parse will fail and give a list of mismatch removes
511if the revisions being removed have changed since base-rev was set.
512Intended for use with layered manifests using hash revisions to prevent
513patch branches hiding newer upstream revisions. Also compares named refs
514like branches or tags but is misleading if branches are used as base-rev.
515Same syntax as the corresponding element of `project`.
516
Mike Frysinger51e39d52020-12-04 05:32:06 -0500517### Element repo-hooks
518
519NB: See the [practical documentation](./repo-hooks.md) for using repo hooks.
520
521Only one repo-hooks element may be specified at a time.
522Attempting to redefine it will fail to parse.
523
524Attribute `in-project`: The project where the hooks are defined. The value
525must match the `name` attribute (**not** the `path` attribute) of a previously
526defined `project` element.
527
528Attribute `enabled-list`: List of hooks to use, whitespace or comma separated.
529
Raman Tenneti1bb4fb22021-01-07 16:50:45 -0800530### Element superproject
531
532***
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700533*Note*: This is currently a WIP.
Raman Tenneti1bb4fb22021-01-07 16:50:45 -0800534***
535
536NB: See the [git superprojects documentation](
537https://en.wikibooks.org/wiki/Git/Submodules_and_Superprojects) for background
538information.
539
540This element is used to specify the URL of the superproject. It has "name" and
541"remote" as atrributes. Only "name" is required while the others have
542reasonable defaults. At most one superproject may be specified.
543Attempting to redefine it will fail to parse.
544
545Attribute `name`: A unique name for the superproject. This attribute has the
546same meaning as project's name attribute. See the
547[element project](#element-project) for more information.
548
549Attribute `remote`: Name of a previously defined remote element.
550If not supplied the remote given by the default element is used.
551
Xin Lie0b16a22021-09-26 23:20:32 -0700552Attribute `revision`: Name of the Git branch the manifest wants
553to track for this superproject. If not supplied the revision given
554by the remote element is used if applicable, else the default
555element is used.
556
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700557### Element contactinfo
558
559***
560*Note*: This is currently a WIP.
561***
562
563This element is used to let manifest authors self-register contact info.
564It has "bugurl" as a required atrribute. This element can be repeated,
565and any later entries will clobber earlier ones. This would allow manifest
566authors who extend manifests to specify their own contact info.
567
568Attribute `bugurl`: The URL to file a bug against the manifest owner.
569
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400570### Element include
Brian Harring26448742011-04-28 05:04:41 -0700571
572This element provides the capability of including another manifest
573file into the originating manifest. Normal rules apply for the
David Pursehouse9f3406e2012-11-14 08:52:25 +0900574target manifest to include - it must be a usable manifest on its own.
Brian Harring26448742011-04-28 05:04:41 -0700575
David Pursehouse9f3406e2012-11-14 08:52:25 +0900576Attribute `name`: the manifest to include, specified relative to
577the manifest repository's root.
Brian Harring26448742011-04-28 05:04:41 -0700578
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500579"name" may not be an absolute path or use "." or ".." path components.
580These restrictions are not enforced for [Local Manifests].
581
Fredrik de Groot352c93b2020-10-06 12:55:14 +0200582Attribute `groups`: List of additional groups to which all projects
583in the included manifest belong. This appends and recurses, meaning
LaMont Jonescc879a92021-11-18 22:40:18 +0000584all projects in included manifests carry all parent include groups.
Fredrik de Groot352c93b2020-10-06 12:55:14 +0200585Same syntax as the corresponding element of `project`.
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800586
Shuchuan Zeng3e3340d2023-04-18 10:36:50 +0800587Attribute `revision`: Name of a Git branch (e.g. `main` or `refs/heads/main`)
588default to which all projects in the included manifest belong.
589
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500590## Local Manifests {#local-manifests}
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800591
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900592Additional remotes and projects may be added through local manifest
593files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800594
595For example:
596
Mike Frysinger3891b752018-10-05 19:26:15 -0400597 $ ls .repo/local_manifests
598 local_manifest.xml
599 another_local_manifest.xml
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900600
Mike Frysinger3891b752018-10-05 19:26:15 -0400601 $ cat .repo/local_manifests/local_manifest.xml
602 <?xml version="1.0" encoding="UTF-8"?>
603 <manifest>
604 <project path="manifest"
605 name="tools/manifest" />
606 <project path="platform-manifest"
607 name="platform/manifest" />
608 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800609
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900610Users may add projects to the local manifest(s) prior to a `repo sync`
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800611invocation, instructing repo to automatically download and manage
612these extra projects.
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900613
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900614Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
615be loaded in alphabetical order.
616
Raman Tenneti78f4dd32021-06-07 13:27:37 -0700617Projects from local manifest files are added into
618local::<local manifest filename> group.
619
Mike Frysinger4e1fc102020-09-06 14:42:47 -0400620The legacy `$TOP_DIR/.repo/local_manifest.xml` path is no longer supported.
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500621
622
623[copyfile]: #Element-copyfile
624[linkfile]: #Element-linkfile
625[Local Manifests]: #local-manifests