summaryrefslogtreecommitdiffstats
path: root/docs/manifest-format.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/manifest-format.md')
-rw-r--r--docs/manifest-format.md161
1 files changed, 136 insertions, 25 deletions
diff --git a/docs/manifest-format.md b/docs/manifest-format.md
index 93d9b960..8e0049b3 100644
--- a/docs/manifest-format.md
+++ b/docs/manifest-format.md
@@ -21,6 +21,7 @@ following DTD:
21 21
22```xml 22```xml
23<!DOCTYPE manifest [ 23<!DOCTYPE manifest [
24
24 <!ELEMENT manifest (notice?, 25 <!ELEMENT manifest (notice?,
25 remote*, 26 remote*,
26 default?, 27 default?,
@@ -29,11 +30,13 @@ following DTD:
29 project*, 30 project*,
30 extend-project*, 31 extend-project*,
31 repo-hooks?, 32 repo-hooks?,
33 superproject?,
34 contactinfo?,
32 include*)> 35 include*)>
33 36
34 <!ELEMENT notice (#PCDATA)> 37 <!ELEMENT notice (#PCDATA)>
35 38
36 <!ELEMENT remote EMPTY> 39 <!ELEMENT remote (annotation*)>
37 <!ATTLIST remote name ID #REQUIRED> 40 <!ATTLIST remote name ID #REQUIRED>
38 <!ATTLIST remote alias CDATA #IMPLIED> 41 <!ATTLIST remote alias CDATA #IMPLIED>
39 <!ATTLIST remote fetch CDATA #REQUIRED> 42 <!ATTLIST remote fetch CDATA #REQUIRED>
@@ -87,21 +90,39 @@ following DTD:
87 <!ELEMENT extend-project EMPTY> 90 <!ELEMENT extend-project EMPTY>
88 <!ATTLIST extend-project name CDATA #REQUIRED> 91 <!ATTLIST extend-project name CDATA #REQUIRED>
89 <!ATTLIST extend-project path CDATA #IMPLIED> 92 <!ATTLIST extend-project path CDATA #IMPLIED>
93 <!ATTLIST extend-project dest-path CDATA #IMPLIED>
90 <!ATTLIST extend-project groups CDATA #IMPLIED> 94 <!ATTLIST extend-project groups CDATA #IMPLIED>
91 <!ATTLIST extend-project revision CDATA #IMPLIED> 95 <!ATTLIST extend-project revision CDATA #IMPLIED>
96 <!ATTLIST extend-project remote CDATA #IMPLIED>
92 97
93 <!ELEMENT remove-project EMPTY> 98 <!ELEMENT remove-project EMPTY>
94 <!ATTLIST remove-project name CDATA #REQUIRED> 99 <!ATTLIST remove-project name CDATA #REQUIRED>
100 <!ATTLIST remove-project optional CDATA #IMPLIED>
95 101
96 <!ELEMENT repo-hooks EMPTY> 102 <!ELEMENT repo-hooks EMPTY>
97 <!ATTLIST repo-hooks in-project CDATA #REQUIRED> 103 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
98 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED> 104 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
99 105
106 <!ELEMENT superproject EMPTY>
107 <!ATTLIST superproject name CDATA #REQUIRED>
108 <!ATTLIST superproject remote IDREF #IMPLIED>
109 <!ATTLIST superproject revision CDATA #IMPLIED>
110
111 <!ELEMENT contactinfo EMPTY>
112 <!ATTLIST contactinfo bugurl CDATA #REQUIRED>
113
100 <!ELEMENT include EMPTY> 114 <!ELEMENT include EMPTY>
101 <!ATTLIST include name CDATA #REQUIRED> 115 <!ATTLIST include name CDATA #REQUIRED>
116 <!ATTLIST include groups CDATA #IMPLIED>
102]> 117]>
103``` 118```
104 119
120For compatibility purposes across repo releases, all unknown elements are
121silently ignored. However, repo reserves all possible names for itself for
122future use. If you want to use custom elements, the `x-*` namespace is
123reserved for that purpose, and repo guarantees to never allocate any
124corresponding names.
125
105A description of the elements and their attributes follows. 126A description of the elements and their attributes follows.
106 127
107 128
@@ -109,6 +130,10 @@ A description of the elements and their attributes follows.
109 130
110The root element of the file. 131The root element of the file.
111 132
133### Element notice
134
135Arbitrary text that is displayed to users whenever `repo sync` finishes.
136The content is simply passed through as it exists in the manifest.
112 137
113### Element remote 138### Element remote
114 139
@@ -141,8 +166,8 @@ Attribute `review`: Hostname of the Gerrit server where reviews
141are uploaded to by `repo upload`. This attribute is optional; 166are uploaded to by `repo upload`. This attribute is optional;
142if not specified then `repo upload` will not function. 167if not specified then `repo upload` will not function.
143 168
144Attribute `revision`: Name of a Git branch (e.g. `master` or 169Attribute `revision`: Name of a Git branch (e.g. `main` or
145`refs/heads/master`). Remotes with their own revision will override 170`refs/heads/main`). Remotes with their own revision will override
146the default revision. 171the default revision.
147 172
148### Element default 173### Element default
@@ -155,11 +180,11 @@ Attribute `remote`: Name of a previously defined remote element.
155Project elements lacking a remote attribute of their own will use 180Project elements lacking a remote attribute of their own will use
156this remote. 181this remote.
157 182
158Attribute `revision`: Name of a Git branch (e.g. `master` or 183Attribute `revision`: Name of a Git branch (e.g. `main` or
159`refs/heads/master`). Project elements lacking their own 184`refs/heads/main`). Project elements lacking their own
160revision attribute will use this revision. 185revision attribute will use this revision.
161 186
162Attribute `dest-branch`: Name of a Git branch (e.g. `master`). 187Attribute `dest-branch`: Name of a Git branch (e.g. `main`).
163Project elements not setting their own `dest-branch` will inherit 188Project elements not setting their own `dest-branch` will inherit
164this value. If this value is not set, projects will use `revision` 189this value. If this value is not set, projects will use `revision`
165by default instead. 190by default instead.
@@ -235,24 +260,37 @@ name will be prefixed by the parent's.
235The project name must match the name Gerrit knows, if Gerrit is 260The project name must match the name Gerrit knows, if Gerrit is
236being used for code reviews. 261being used for code reviews.
237 262
263"name" must not be empty, and may not be an absolute path or use "." or ".."
264path components. It is always interpreted relative to the remote's fetch
265settings, so if a different base path is needed, declare a different remote
266with the new settings needed.
267These restrictions are not enforced for [Local Manifests].
268
238Attribute `path`: An optional path relative to the top directory 269Attribute `path`: An optional path relative to the top directory
239of the repo client where the Git working directory for this project 270of the repo client where the Git working directory for this project
240should be placed. If not supplied the project name is used. 271should be placed. If not supplied the project "name" is used.
241If the project has a parent element, its path will be prefixed 272If the project has a parent element, its path will be prefixed
242by the parent's. 273by the parent's.
243 274
275"path" may not be an absolute path or use "." or ".." path components.
276These restrictions are not enforced for [Local Manifests].
277
278If you want to place files into the root of the checkout (e.g. a README or
279Makefile or another build script), use the [copyfile] or [linkfile] elements
280instead.
281
244Attribute `remote`: Name of a previously defined remote element. 282Attribute `remote`: Name of a previously defined remote element.
245If not supplied the remote given by the default element is used. 283If not supplied the remote given by the default element is used.
246 284
247Attribute `revision`: Name of the Git branch the manifest wants 285Attribute `revision`: Name of the Git branch the manifest wants
248to track for this project. Names can be relative to refs/heads 286to track for this project. Names can be relative to refs/heads
249(e.g. just "master") or absolute (e.g. "refs/heads/master"). 287(e.g. just "main") or absolute (e.g. "refs/heads/main").
250Tags and/or explicit SHA-1s should work in theory, but have not 288Tags and/or explicit SHA-1s should work in theory, but have not
251been extensively tested. If not supplied the revision given by 289been extensively tested. If not supplied the revision given by
252the remote element is used if applicable, else the default 290the remote element is used if applicable, else the default
253element is used. 291element is used.
254 292
255Attribute `dest-branch`: Name of a Git branch (e.g. `master`). 293Attribute `dest-branch`: Name of a Git branch (e.g. `main`).
256When using `repo upload`, changes will be submitted for code 294When using `repo upload`, changes will be submitted for code
257review on this branch. If unspecified both here and in the 295review on this branch. If unspecified both here and in the
258default element, `revision` is used instead. 296default element, `revision` is used instead.
@@ -261,7 +299,7 @@ Attribute `groups`: List of groups to which this project belongs,
261whitespace or comma separated. All projects belong to the group 299whitespace or comma separated. All projects belong to the group
262"all", and each project automatically belongs to a group of 300"all", and each project automatically belongs to a group of
263its name:`name` and path:`path`. E.g. for 301its name:`name` and path:`path`. E.g. for
264<project name="monkeys" path="barrel-of"/>, that project 302`<project name="monkeys" path="barrel-of"/>`, that project
265definition is implicitly in the following manifest groups: 303definition is implicitly in the following manifest groups:
266default, name:monkeys, and path:barrel-of. If you place a project in the 304default, name:monkeys, and path:barrel-of. If you place a project in the
267group "notdefault", it will not be automatically downloaded by repo. 305group "notdefault", it will not be automatically downloaded by repo.
@@ -300,21 +338,29 @@ against changes to the original manifest.
300Attribute `path`: If specified, limit the change to projects checked out 338Attribute `path`: If specified, limit the change to projects checked out
301at the specified path, rather than all projects with the given name. 339at the specified path, rather than all projects with the given name.
302 340
341Attribute `dest-path`: If specified, a path relative to the top directory
342of the repo client where the Git working directory for this project
343should be placed. This is used to move a project in the checkout by
344overriding the existing `path` setting.
345
303Attribute `groups`: List of additional groups to which this project 346Attribute `groups`: List of additional groups to which this project
304belongs. Same syntax as the corresponding element of `project`. 347belongs. Same syntax as the corresponding element of `project`.
305 348
306Attribute `revision`: If specified, overrides the revision of the original 349Attribute `revision`: If specified, overrides the revision of the original
307project. Same syntax as the corresponding element of `project`. 350project. Same syntax as the corresponding element of `project`.
308 351
352Attribute `remote`: If specified, overrides the remote of the original
353project. Same syntax as the corresponding element of `project`.
354
309### Element annotation 355### Element annotation
310 356
311Zero or more annotation elements may be specified as children of a 357Zero or more annotation elements may be specified as children of a
312project element. Each element describes a name-value pair that will be 358project or remote element. Each element describes a name-value pair.
313exported into each project's environment during a 'forall' command, 359For projects, this name-value pair will be exported into each project's
314prefixed with REPO__. In addition, there is an optional attribute 360environment during a 'forall' command, prefixed with `REPO__`. In addition,
315"keep" which accepts the case insensitive values "true" (default) or 361there is an optional attribute "keep" which accepts the case insensitive values
316"false". This attribute determines whether or not the annotation will 362"true" (default) or "false". This attribute determines whether or not the
317be kept when exported with the manifest subcommand. 363annotation will be kept when exported with the manifest subcommand.
318 364
319### Element copyfile 365### Element copyfile
320 366
@@ -338,7 +384,7 @@ It's just like copyfile and runs at the same time as copyfile but
338instead of copying it creates a symlink. 384instead of copying it creates a symlink.
339 385
340The symlink is created at "dest" (relative to the top of the tree) and 386The symlink is created at "dest" (relative to the top of the tree) and
341points to the path specified by "src". 387points to the path specified by "src" which is a path in the project.
342 388
343Parent directories of "dest" will be automatically created if missing. 389Parent directories of "dest" will be automatically created if missing.
344 390
@@ -355,6 +401,62 @@ This element is mostly useful in a local manifest file, where
355the user can remove a project, and possibly replace it with their 401the user can remove a project, and possibly replace it with their
356own definition. 402own definition.
357 403
404Attribute `optional`: Set to true to ignore remove-project elements with no
405matching `project` element.
406
407### Element repo-hooks
408
409NB: See the [practical documentation](./repo-hooks.md) for using repo hooks.
410
411Only one repo-hooks element may be specified at a time.
412Attempting to redefine it will fail to parse.
413
414Attribute `in-project`: The project where the hooks are defined. The value
415must match the `name` attribute (**not** the `path` attribute) of a previously
416defined `project` element.
417
418Attribute `enabled-list`: List of hooks to use, whitespace or comma separated.
419
420### Element superproject
421
422***
423*Note*: This is currently a WIP.
424***
425
426NB: See the [git superprojects documentation](
427https://en.wikibooks.org/wiki/Git/Submodules_and_Superprojects) for background
428information.
429
430This element is used to specify the URL of the superproject. It has "name" and
431"remote" as atrributes. Only "name" is required while the others have
432reasonable defaults. At most one superproject may be specified.
433Attempting to redefine it will fail to parse.
434
435Attribute `name`: A unique name for the superproject. This attribute has the
436same meaning as project's name attribute. See the
437[element project](#element-project) for more information.
438
439Attribute `remote`: Name of a previously defined remote element.
440If not supplied the remote given by the default element is used.
441
442Attribute `revision`: Name of the Git branch the manifest wants
443to track for this superproject. If not supplied the revision given
444by the remote element is used if applicable, else the default
445element is used.
446
447### Element contactinfo
448
449***
450*Note*: This is currently a WIP.
451***
452
453This element is used to let manifest authors self-register contact info.
454It has "bugurl" as a required atrribute. This element can be repeated,
455and any later entries will clobber earlier ones. This would allow manifest
456authors who extend manifests to specify their own contact info.
457
458Attribute `bugurl`: The URL to file a bug against the manifest owner.
459
358### Element include 460### Element include
359 461
360This element provides the capability of including another manifest 462This element provides the capability of including another manifest
@@ -364,8 +466,15 @@ target manifest to include - it must be a usable manifest on its own.
364Attribute `name`: the manifest to include, specified relative to 466Attribute `name`: the manifest to include, specified relative to
365the manifest repository's root. 467the manifest repository's root.
366 468
469"name" may not be an absolute path or use "." or ".." path components.
470These restrictions are not enforced for [Local Manifests].
471
472Attribute `groups`: List of additional groups to which all projects
473in the included manifest belong. This appends and recurses, meaning
474all projects in sub-manifests carry all parent include groups.
475Same syntax as the corresponding element of `project`.
367 476
368## Local Manifests 477## Local Manifests {#local-manifests}
369 478
370Additional remotes and projects may be added through local manifest 479Additional remotes and projects may be added through local manifest
371files stored in `$TOP_DIR/.repo/local_manifests/*.xml`. 480files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
@@ -392,10 +501,12 @@ these extra projects.
392Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will 501Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
393be loaded in alphabetical order. 502be loaded in alphabetical order.
394 503
395Additional remotes and projects may also be added through a local 504Projects from local manifest files are added into
396manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method 505local::<local manifest filename> group.
397is deprecated in favor of using multiple manifest files as mentioned 506
398above. 507The legacy `$TOP_DIR/.repo/local_manifest.xml` path is no longer supported.
508
399 509
400If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before 510[copyfile]: #Element-copyfile
401any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`. 511[linkfile]: #Element-linkfile
512[Local Manifests]: #local-manifests