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