diff options
author | Mike Frysinger <vapier@google.com> | 2018-10-05 19:26:15 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2018-10-05 19:32:51 -0400 |
commit | 3891b7519d35b6bac3e81744c846ca2ed0bd1be2 (patch) | |
tree | b968b6c5611ea21703dfc1144f7fe175c9409dfb /docs/manifest-format.txt | |
parent | 2b42d288c08bdfd0fc3402fa118d91a1aebdb655 (diff) | |
download | git-repo-3891b7519d35b6bac3e81744c846ca2ed0bd1be2.tar.gz |
manifest-format: convert to markdown
The gitiles system doesn't render .txt files, so convert this to .md
for better display online.
Change-Id: Ie12e46daf008dd8c97ae2ffd21fb68bd948fe625
Diffstat (limited to 'docs/manifest-format.txt')
-rw-r--r-- | docs/manifest-format.txt | 395 |
1 files changed, 0 insertions, 395 deletions
diff --git a/docs/manifest-format.txt b/docs/manifest-format.txt deleted file mode 100644 index 0c957dd5..00000000 --- a/docs/manifest-format.txt +++ /dev/null | |||
@@ -1,395 +0,0 @@ | |||
1 | repo Manifest Format | ||
2 | ==================== | ||
3 | |||
4 | A repo manifest describes the structure of a repo client; that is | ||
5 | the directories that are visible and where they should be obtained | ||
6 | from with git. | ||
7 | |||
8 | The basic structure of a manifest is a bare Git repository holding | ||
9 | a single 'default.xml' XML file in the top level directory. | ||
10 | |||
11 | Manifests are inherently version controlled, since they are kept | ||
12 | within a Git repository. Updates to manifests are automatically | ||
13 | obtained by clients during `repo sync`. | ||
14 | |||
15 | |||
16 | XML File Format | ||
17 | --------------- | ||
18 | |||
19 | A manifest XML file (e.g. 'default.xml') roughly conforms to the | ||
20 | following DTD: | ||
21 | |||
22 | <!DOCTYPE manifest [ | ||
23 | <!ELEMENT manifest (notice?, | ||
24 | remote*, | ||
25 | default?, | ||
26 | manifest-server?, | ||
27 | remove-project*, | ||
28 | project*, | ||
29 | extend-project*, | ||
30 | repo-hooks?, | ||
31 | include*)> | ||
32 | |||
33 | <!ELEMENT notice (#PCDATA)> | ||
34 | |||
35 | <!ELEMENT remote EMPTY> | ||
36 | <!ATTLIST remote name ID #REQUIRED> | ||
37 | <!ATTLIST remote alias CDATA #IMPLIED> | ||
38 | <!ATTLIST remote fetch CDATA #REQUIRED> | ||
39 | <!ATTLIST remote pushurl CDATA #IMPLIED> | ||
40 | <!ATTLIST remote review CDATA #IMPLIED> | ||
41 | <!ATTLIST remote revision CDATA #IMPLIED> | ||
42 | |||
43 | <!ELEMENT default EMPTY> | ||
44 | <!ATTLIST default remote IDREF #IMPLIED> | ||
45 | <!ATTLIST default revision CDATA #IMPLIED> | ||
46 | <!ATTLIST default dest-branch CDATA #IMPLIED> | ||
47 | <!ATTLIST default upstream CDATA #IMPLIED> | ||
48 | <!ATTLIST default sync-j CDATA #IMPLIED> | ||
49 | <!ATTLIST default sync-c CDATA #IMPLIED> | ||
50 | <!ATTLIST default sync-s CDATA #IMPLIED> | ||
51 | <!ATTLIST default sync-tags CDATA #IMPLIED> | ||
52 | |||
53 | <!ELEMENT manifest-server EMPTY> | ||
54 | <!ATTLIST manifest-server url CDATA #REQUIRED> | ||
55 | |||
56 | <!ELEMENT project (annotation*, | ||
57 | project*, | ||
58 | copyfile*, | ||
59 | linkfile*)> | ||
60 | <!ATTLIST project name CDATA #REQUIRED> | ||
61 | <!ATTLIST project path CDATA #IMPLIED> | ||
62 | <!ATTLIST project remote IDREF #IMPLIED> | ||
63 | <!ATTLIST project revision CDATA #IMPLIED> | ||
64 | <!ATTLIST project dest-branch CDATA #IMPLIED> | ||
65 | <!ATTLIST project groups CDATA #IMPLIED> | ||
66 | <!ATTLIST project sync-c CDATA #IMPLIED> | ||
67 | <!ATTLIST project sync-s CDATA #IMPLIED> | ||
68 | <!ATTLIST default sync-tags CDATA #IMPLIED> | ||
69 | <!ATTLIST project upstream CDATA #IMPLIED> | ||
70 | <!ATTLIST project clone-depth CDATA #IMPLIED> | ||
71 | <!ATTLIST project force-path CDATA #IMPLIED> | ||
72 | |||
73 | <!ELEMENT annotation EMPTY> | ||
74 | <!ATTLIST annotation name CDATA #REQUIRED> | ||
75 | <!ATTLIST annotation value CDATA #REQUIRED> | ||
76 | <!ATTLIST annotation keep CDATA "true"> | ||
77 | |||
78 | <!ELEMENT copyfile EMPTY> | ||
79 | <!ATTLIST copyfile src CDATA #REQUIRED> | ||
80 | <!ATTLIST copyfile dest CDATA #REQUIRED> | ||
81 | |||
82 | <!ELEMENT linkfile EMPTY> | ||
83 | <!ATTLIST linkfile src CDATA #REQUIRED> | ||
84 | <!ATTLIST linkfile dest CDATA #REQUIRED> | ||
85 | |||
86 | <!ELEMENT extend-project EMPTY> | ||
87 | <!ATTLIST extend-project name CDATA #REQUIRED> | ||
88 | <!ATTLIST extend-project path CDATA #IMPLIED> | ||
89 | <!ATTLIST extend-project groups CDATA #IMPLIED> | ||
90 | <!ATTLIST extend-project revision CDATA #IMPLIED> | ||
91 | |||
92 | <!ELEMENT remove-project EMPTY> | ||
93 | <!ATTLIST remove-project name CDATA #REQUIRED> | ||
94 | |||
95 | <!ELEMENT repo-hooks EMPTY> | ||
96 | <!ATTLIST repo-hooks in-project CDATA #REQUIRED> | ||
97 | <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED> | ||
98 | |||
99 | <!ELEMENT include EMPTY> | ||
100 | <!ATTLIST include name CDATA #REQUIRED> | ||
101 | ]> | ||
102 | |||
103 | A description of the elements and their attributes follows. | ||
104 | |||
105 | |||
106 | Element manifest | ||
107 | ---------------- | ||
108 | |||
109 | The root element of the file. | ||
110 | |||
111 | |||
112 | Element remote | ||
113 | -------------- | ||
114 | |||
115 | One or more remote elements may be specified. Each remote element | ||
116 | specifies a Git URL shared by one or more projects and (optionally) | ||
117 | the Gerrit review server those projects upload changes through. | ||
118 | |||
119 | Attribute `name`: A short name unique to this manifest file. The | ||
120 | name specified here is used as the remote name in each project's | ||
121 | .git/config, and is therefore automatically available to commands | ||
122 | like `git fetch`, `git remote`, `git pull` and `git push`. | ||
123 | |||
124 | Attribute `alias`: The alias, if specified, is used to override | ||
125 | `name` to be set as the remote name in each project's .git/config. | ||
126 | Its value can be duplicated while attribute `name` has to be unique | ||
127 | in the manifest file. This helps each project to be able to have | ||
128 | same remote name which actually points to different remote url. | ||
129 | |||
130 | Attribute `fetch`: The Git URL prefix for all projects which use | ||
131 | this remote. Each project's name is appended to this prefix to | ||
132 | form the actual URL used to clone the project. | ||
133 | |||
134 | Attribute `pushurl`: The Git "push" URL prefix for all projects | ||
135 | which use this remote. Each project's name is appended to this | ||
136 | prefix to form the actual URL used to "git push" the project. | ||
137 | This attribute is optional; if not specified then "git push" | ||
138 | will use the same URL as the `fetch` attribute. | ||
139 | |||
140 | Attribute `review`: Hostname of the Gerrit server where reviews | ||
141 | are uploaded to by `repo upload`. This attribute is optional; | ||
142 | if not specified then `repo upload` will not function. | ||
143 | |||
144 | Attribute `revision`: Name of a Git branch (e.g. `master` or | ||
145 | `refs/heads/master`). Remotes with their own revision will override | ||
146 | the default revision. | ||
147 | |||
148 | Element default | ||
149 | --------------- | ||
150 | |||
151 | At most one default element may be specified. Its remote and | ||
152 | revision attributes are used when a project element does not | ||
153 | specify its own remote or revision attribute. | ||
154 | |||
155 | Attribute `remote`: Name of a previously defined remote element. | ||
156 | Project elements lacking a remote attribute of their own will use | ||
157 | this remote. | ||
158 | |||
159 | Attribute `revision`: Name of a Git branch (e.g. `master` or | ||
160 | `refs/heads/master`). Project elements lacking their own | ||
161 | revision attribute will use this revision. | ||
162 | |||
163 | Attribute `dest-branch`: Name of a Git branch (e.g. `master`). | ||
164 | Project elements not setting their own `dest-branch` will inherit | ||
165 | this value. If this value is not set, projects will use `revision` | ||
166 | by default instead. | ||
167 | |||
168 | Attribute `upstream`: Name of the Git ref in which a sha1 | ||
169 | can be found. Used when syncing a revision locked manifest in | ||
170 | -c mode to avoid having to sync the entire ref space. Project elements | ||
171 | not setting their own `upstream` will inherit this value. | ||
172 | |||
173 | Attribute `sync-j`: Number of parallel jobs to use when synching. | ||
174 | |||
175 | Attribute `sync-c`: Set to true to only sync the given Git | ||
176 | branch (specified in the `revision` attribute) rather than the | ||
177 | whole ref space. Project elements lacking a sync-c element of | ||
178 | their own will use this value. | ||
179 | |||
180 | Attribute `sync-s`: Set to true to also sync sub-projects. | ||
181 | |||
182 | Attribute `sync-tags`: Set to false to only sync the given Git | ||
183 | branch (specified in the `revision` attribute) rather than | ||
184 | the other ref tags. | ||
185 | |||
186 | |||
187 | Element manifest-server | ||
188 | ----------------------- | ||
189 | |||
190 | At most one manifest-server may be specified. The url attribute | ||
191 | is used to specify the URL of a manifest server, which is an | ||
192 | XML RPC service. | ||
193 | |||
194 | The manifest server should implement the following RPC methods: | ||
195 | |||
196 | GetApprovedManifest(branch, target) | ||
197 | |||
198 | Return a manifest in which each project is pegged to a known good revision | ||
199 | for the current branch and target. This is used by repo sync when the | ||
200 | --smart-sync option is given. | ||
201 | |||
202 | The target to use is defined by environment variables TARGET_PRODUCT | ||
203 | and TARGET_BUILD_VARIANT. These variables are used to create a string | ||
204 | of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug. | ||
205 | If one of those variables or both are not present, the program will call | ||
206 | GetApprovedManifest without the target parameter and the manifest server | ||
207 | should choose a reasonable default target. | ||
208 | |||
209 | GetManifest(tag) | ||
210 | |||
211 | Return a manifest in which each project is pegged to the revision at | ||
212 | the specified tag. This is used by repo sync when the --smart-tag option | ||
213 | is given. | ||
214 | |||
215 | |||
216 | Element project | ||
217 | --------------- | ||
218 | |||
219 | One or more project elements may be specified. Each element | ||
220 | describes a single Git repository to be cloned into the repo | ||
221 | client workspace. You may specify Git-submodules by creating a | ||
222 | nested project. Git-submodules will be automatically | ||
223 | recognized and inherit their parent's attributes, but those | ||
224 | may be overridden by an explicitly specified project element. | ||
225 | |||
226 | Attribute `name`: A unique name for this project. The project's | ||
227 | name is appended onto its remote's fetch URL to generate the actual | ||
228 | URL to configure the Git remote with. The URL gets formed as: | ||
229 | |||
230 | ${remote_fetch}/${project_name}.git | ||
231 | |||
232 | where ${remote_fetch} is the remote's fetch attribute and | ||
233 | ${project_name} is the project's name attribute. The suffix ".git" | ||
234 | is always appended as repo assumes the upstream is a forest of | ||
235 | bare Git repositories. If the project has a parent element, its | ||
236 | name will be prefixed by the parent's. | ||
237 | |||
238 | The project name must match the name Gerrit knows, if Gerrit is | ||
239 | being used for code reviews. | ||
240 | |||
241 | Attribute `path`: An optional path relative to the top directory | ||
242 | of the repo client where the Git working directory for this project | ||
243 | should be placed. If not supplied the project name is used. | ||
244 | If the project has a parent element, its path will be prefixed | ||
245 | by the parent's. | ||
246 | |||
247 | Attribute `remote`: Name of a previously defined remote element. | ||
248 | If not supplied the remote given by the default element is used. | ||
249 | |||
250 | Attribute `revision`: Name of the Git branch the manifest wants | ||
251 | to track for this project. Names can be relative to refs/heads | ||
252 | (e.g. just "master") or absolute (e.g. "refs/heads/master"). | ||
253 | Tags and/or explicit SHA-1s should work in theory, but have not | ||
254 | been extensively tested. If not supplied the revision given by | ||
255 | the remote element is used if applicable, else the default | ||
256 | element is used. | ||
257 | |||
258 | Attribute `dest-branch`: Name of a Git branch (e.g. `master`). | ||
259 | When using `repo upload`, changes will be submitted for code | ||
260 | review on this branch. If unspecified both here and in the | ||
261 | default element, `revision` is used instead. | ||
262 | |||
263 | Attribute `groups`: List of groups to which this project belongs, | ||
264 | whitespace or comma separated. All projects belong to the group | ||
265 | "all", and each project automatically belongs to a group of | ||
266 | its name:`name` and path:`path`. E.g. for | ||
267 | <project name="monkeys" path="barrel-of"/>, that project | ||
268 | definition is implicitly in the following manifest groups: | ||
269 | default, name:monkeys, and path:barrel-of. If you place a project in the | ||
270 | group "notdefault", it will not be automatically downloaded by repo. | ||
271 | If the project has a parent element, the `name` and `path` here | ||
272 | are the prefixed ones. | ||
273 | |||
274 | Attribute `sync-c`: Set to true to only sync the given Git | ||
275 | branch (specified in the `revision` attribute) rather than the | ||
276 | whole ref space. | ||
277 | |||
278 | Attribute `sync-s`: Set to true to also sync sub-projects. | ||
279 | |||
280 | Attribute `upstream`: Name of the Git ref in which a sha1 | ||
281 | can be found. Used when syncing a revision locked manifest in | ||
282 | -c mode to avoid having to sync the entire ref space. | ||
283 | |||
284 | Attribute `clone-depth`: Set the depth to use when fetching this | ||
285 | project. If specified, this value will override any value given | ||
286 | to repo init with the --depth option on the command line. | ||
287 | |||
288 | Attribute `force-path`: Set to true to force this project to create the | ||
289 | local mirror repository according to its `path` attribute (if supplied) | ||
290 | rather than the `name` attribute. This attribute only applies to the | ||
291 | local mirrors syncing, it will be ignored when syncing the projects in a | ||
292 | client working directory. | ||
293 | |||
294 | Element extend-project | ||
295 | ---------------------- | ||
296 | |||
297 | Modify the attributes of the named project. | ||
298 | |||
299 | This element is mostly useful in a local manifest file, to modify the | ||
300 | attributes of an existing project without completely replacing the | ||
301 | existing project definition. This makes the local manifest more robust | ||
302 | against changes to the original manifest. | ||
303 | |||
304 | Attribute `path`: If specified, limit the change to projects checked out | ||
305 | at the specified path, rather than all projects with the given name. | ||
306 | |||
307 | Attribute `groups`: List of additional groups to which this project | ||
308 | belongs. Same syntax as the corresponding element of `project`. | ||
309 | |||
310 | Attribute `revision`: If specified, overrides the revision of the original | ||
311 | project. Same syntax as the corresponding element of `project`. | ||
312 | |||
313 | Element annotation | ||
314 | ------------------ | ||
315 | |||
316 | Zero or more annotation elements may be specified as children of a | ||
317 | project element. Each element describes a name-value pair that will be | ||
318 | exported into each project's environment during a 'forall' command, | ||
319 | prefixed with REPO__. In addition, there is an optional attribute | ||
320 | "keep" which accepts the case insensitive values "true" (default) or | ||
321 | "false". This attribute determines whether or not the annotation will | ||
322 | be kept when exported with the manifest subcommand. | ||
323 | |||
324 | Element copyfile | ||
325 | ---------------- | ||
326 | |||
327 | Zero or more copyfile elements may be specified as children of a | ||
328 | project element. Each element describes a src-dest pair of files; | ||
329 | the "src" file will be copied to the "dest" place during 'repo sync' | ||
330 | command. | ||
331 | "src" is project relative, "dest" is relative to the top of the tree. | ||
332 | |||
333 | Element linkfile | ||
334 | ---------------- | ||
335 | |||
336 | It's just like copyfile and runs at the same time as copyfile but | ||
337 | instead of copying it creates a symlink. | ||
338 | |||
339 | Element remove-project | ||
340 | ---------------------- | ||
341 | |||
342 | Deletes the named project from the internal manifest table, possibly | ||
343 | allowing a subsequent project element in the same manifest file to | ||
344 | replace the project with a different source. | ||
345 | |||
346 | This element is mostly useful in a local manifest file, where | ||
347 | the user can remove a project, and possibly replace it with their | ||
348 | own definition. | ||
349 | |||
350 | Element include | ||
351 | --------------- | ||
352 | |||
353 | This element provides the capability of including another manifest | ||
354 | file into the originating manifest. Normal rules apply for the | ||
355 | target manifest to include - it must be a usable manifest on its own. | ||
356 | |||
357 | Attribute `name`: the manifest to include, specified relative to | ||
358 | the manifest repository's root. | ||
359 | |||
360 | |||
361 | Local Manifests | ||
362 | =============== | ||
363 | |||
364 | Additional remotes and projects may be added through local manifest | ||
365 | files stored in `$TOP_DIR/.repo/local_manifests/*.xml`. | ||
366 | |||
367 | For example: | ||
368 | |||
369 | $ ls .repo/local_manifests | ||
370 | local_manifest.xml | ||
371 | another_local_manifest.xml | ||
372 | |||
373 | $ cat .repo/local_manifests/local_manifest.xml | ||
374 | <?xml version="1.0" encoding="UTF-8"?> | ||
375 | <manifest> | ||
376 | <project path="manifest" | ||
377 | name="tools/manifest" /> | ||
378 | <project path="platform-manifest" | ||
379 | name="platform/manifest" /> | ||
380 | </manifest> | ||
381 | |||
382 | Users may add projects to the local manifest(s) prior to a `repo sync` | ||
383 | invocation, instructing repo to automatically download and manage | ||
384 | these extra projects. | ||
385 | |||
386 | Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will | ||
387 | be loaded in alphabetical order. | ||
388 | |||
389 | Additional remotes and projects may also be added through a local | ||
390 | manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method | ||
391 | is deprecated in favor of using multiple manifest files as mentioned | ||
392 | above. | ||
393 | |||
394 | If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before | ||
395 | any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`. | ||