blob: 4b979c79e73580d6e964d3dd746f4c9cefc0472f [file] [log] [blame]
Shawn O. Pearce3e548192008-11-04 11:19:36 -08001repo Manifest Format
2====================
3
4A repo manifest describes the structure of a repo client; that is
5the directories that are visible and where they should be obtained
6from with git.
7
8The basic structure of a manifest is a bare Git repository holding
9a single 'default.xml' XML file in the top level directory.
10
11Manifests are inherently version controlled, since they are kept
12within a Git repository. Updates to manifests are automatically
13obtained by clients during `repo sync`.
14
15
16XML File Format
17---------------
18
19A manifest XML file (e.g. 'default.xml') roughly conforms to the
20following DTD:
21
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080022 <!DOCTYPE manifest [
Doug Anderson2b8db3c2010-11-01 15:08:06 -070023 <!ELEMENT manifest (notice?,
24 remote*,
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080025 default?,
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070026 manifest-server?,
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080027 remove-project*,
Doug Anderson37282b42011-03-04 11:54:18 -080028 project*,
Josh Triplett884a3872014-06-12 14:57:29 -070029 extend-project*,
Doug Anderson37282b42011-03-04 11:54:18 -080030 repo-hooks?)>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053031
Doug Anderson2b8db3c2010-11-01 15:08:06 -070032 <!ELEMENT notice (#PCDATA)>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053033
Jimmie Wester38e43872012-10-24 14:35:05 +020034 <!ELEMENT remote (projecthook?)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080035 <!ATTLIST remote name ID #REQUIRED>
Yestin Sunb292b982012-07-02 07:32:50 -070036 <!ATTLIST remote alias CDATA #IMPLIED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080037 <!ATTLIST remote fetch CDATA #REQUIRED>
38 <!ATTLIST remote review CDATA #IMPLIED>
Anthony King36ea2fb2014-05-06 11:54:01 +010039 <!ATTLIST remote revision CDATA #IMPLIED>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053040
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080041 <!ELEMENT default (EMPTY)>
Bryan Jacobsf609f912013-05-06 13:36:24 -040042 <!ATTLIST default remote IDREF #IMPLIED>
43 <!ATTLIST default revision CDATA #IMPLIED>
44 <!ATTLIST default dest-branch CDATA #IMPLIED>
45 <!ATTLIST default sync-j CDATA #IMPLIED>
46 <!ATTLIST default sync-c CDATA #IMPLIED>
47 <!ATTLIST default sync-s CDATA #IMPLIED>
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070048
49 <!ELEMENT manifest-server (EMPTY)>
50 <!ATTLIST url CDATA #REQUIRED>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053051
Warren Turkal53d6a7b2013-12-10 15:30:03 -080052 <!ELEMENT project (annotation*,
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +080053 project*)>
Bryan Jacobsf609f912013-05-06 13:36:24 -040054 <!ATTLIST project name CDATA #REQUIRED>
55 <!ATTLIST project path CDATA #IMPLIED>
56 <!ATTLIST project remote IDREF #IMPLIED>
57 <!ATTLIST project revision CDATA #IMPLIED>
58 <!ATTLIST project dest-branch CDATA #IMPLIED>
59 <!ATTLIST project groups CDATA #IMPLIED>
60 <!ATTLIST project sync-c CDATA #IMPLIED>
61 <!ATTLIST project sync-s CDATA #IMPLIED>
David Pursehouse4e465202012-11-27 22:20:10 +090062 <!ATTLIST project upstream CDATA #IMPLIED>
David Pursehouseede7f122012-11-27 22:25:30 +090063 <!ATTLIST project clone-depth CDATA #IMPLIED>
Scott Fandb83b1b2013-02-28 09:34:14 +080064 <!ATTLIST project force-path CDATA #IMPLIED>
James W. Mills24c13082012-04-12 15:04:13 -050065
66 <!ELEMENT annotation (EMPTY)>
67 <!ATTLIST annotation name CDATA #REQUIRED>
68 <!ATTLIST annotation value CDATA #REQUIRED>
69 <!ATTLIST annotation keep CDATA "true">
Chirayu Desaid5a5b192013-11-21 19:15:30 +053070
Josh Triplett884a3872014-06-12 14:57:29 -070071 <!ELEMENT extend-project>
72 <!ATTLIST extend-project name CDATA #REQUIRED>
73 <!ATTLIST extend-project path CDATA #IMPLIED>
74 <!ATTLIST extend-project groups CDATA #IMPLIED>
75
Jimmie Wester38e43872012-10-24 14:35:05 +020076 <!ELEMENT projecthook (EMPTY)>
77 <!ATTLIST projecthook name CDATA #REQUIRED>
78 <!ATTLIST projecthook revision CDATA #REQUIRED>
79
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080080 <!ELEMENT remove-project (EMPTY)>
81 <!ATTLIST remove-project name CDATA #REQUIRED>
Doug Anderson37282b42011-03-04 11:54:18 -080082
83 <!ELEMENT repo-hooks (EMPTY)>
84 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
85 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Brian Harring26448742011-04-28 05:04:41 -070086
87 <!ELEMENT include (EMPTY)>
88 <!ATTLIST include name CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080089 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080090
91A description of the elements and their attributes follows.
92
93
94Element manifest
95----------------
96
97The root element of the file.
98
99
100Element remote
101--------------
102
103One or more remote elements may be specified. Each remote element
104specifies a Git URL shared by one or more projects and (optionally)
105the Gerrit review server those projects upload changes through.
106
107Attribute `name`: A short name unique to this manifest file. The
108name specified here is used as the remote name in each project's
109.git/config, and is therefore automatically available to commands
110like `git fetch`, `git remote`, `git pull` and `git push`.
111
Yestin Sunb292b982012-07-02 07:32:50 -0700112Attribute `alias`: The alias, if specified, is used to override
113`name` to be set as the remote name in each project's .git/config.
114Its value can be duplicated while attribute `name` has to be unique
115in the manifest file. This helps each project to be able to have
116same remote name which actually points to different remote url.
117
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800118Attribute `fetch`: The Git URL prefix for all projects which use
119this remote. Each project's name is appended to this prefix to
120form the actual URL used to clone the project.
121
122Attribute `review`: Hostname of the Gerrit server where reviews
123are uploaded to by `repo upload`. This attribute is optional;
124if not specified then `repo upload` will not function.
125
Anthony King36ea2fb2014-05-06 11:54:01 +0100126Attribute `revision`: Name of a Git branch (e.g. `master` or
127`refs/heads/master`). Remotes with their own revision will override
128the default revision.
129
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800130Element default
131---------------
132
133At most one default element may be specified. Its remote and
134revision attributes are used when a project element does not
135specify its own remote or revision attribute.
136
137Attribute `remote`: Name of a previously defined remote element.
138Project elements lacking a remote attribute of their own will use
139this remote.
140
141Attribute `revision`: Name of a Git branch (e.g. `master` or
142`refs/heads/master`). Project elements lacking their own
143revision attribute will use this revision.
144
Bryan Jacobsf609f912013-05-06 13:36:24 -0400145Attribute `dest-branch`: Name of a Git branch (e.g. `master`).
146Project elements not setting their own `dest-branch` will inherit
147this value. If this value is not set, projects will use `revision`
148by default instead.
149
Mani Chandel7a91d512014-07-24 16:27:08 +0530150Attribute `sync-j`: Number of parallel jobs to use when synching.
David Pursehouse4e465202012-11-27 22:20:10 +0900151
Mani Chandel7a91d512014-07-24 16:27:08 +0530152Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900153branch (specified in the `revision` attribute) rather than the
Mani Chandel7a91d512014-07-24 16:27:08 +0530154whole ref space. Project elements lacking a sync-c element of
David Pursehouse4e465202012-11-27 22:20:10 +0900155their own will use this value.
156
Mani Chandel7a91d512014-07-24 16:27:08 +0530157Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900158
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800159
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700160Element manifest-server
161-----------------------
162
163At most one manifest-server may be specified. The url attribute
164is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900165XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700166
David Pursehouse9a27d012012-08-21 14:23:49 +0900167The manifest server should implement the following RPC methods:
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700168
169 GetApprovedManifest(branch, target)
170
David Pursehouse9a27d012012-08-21 14:23:49 +0900171Return a manifest in which each project is pegged to a known good revision
172for the current branch and target.
173
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700174The target to use is defined by environment variables TARGET_PRODUCT
175and TARGET_BUILD_VARIANT. These variables are used to create a string
176of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
177If one of those variables or both are not present, the program will call
David Pursehousedaa851f2012-08-21 13:52:18 +0900178GetApprovedManifest without the target parameter and the manifest server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700179should choose a reasonable default target.
180
David Pursehouse9a27d012012-08-21 14:23:49 +0900181 GetManifest(tag)
182
183Return a manifest in which each project is pegged to the revision at
184the specified tag.
185
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700186
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800187Element project
188---------------
189
190One or more project elements may be specified. Each element
191describes a single Git repository to be cloned into the repo
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800192client workspace. You may specify Git-submodules by creating a
193nested project. Git-submodules will be automatically
194recognized and inherit their parent's attributes, but those
195may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800196
197Attribute `name`: A unique name for this project. The project's
198name is appended onto its remote's fetch URL to generate the actual
199URL to configure the Git remote with. The URL gets formed as:
200
201 ${remote_fetch}/${project_name}.git
202
203where ${remote_fetch} is the remote's fetch attribute and
204${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900205is always appended as repo assumes the upstream is a forest of
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800206bare Git repositories. If the project has a parent element, its
207name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800208
209The project name must match the name Gerrit knows, if Gerrit is
210being used for code reviews.
211
212Attribute `path`: An optional path relative to the top directory
213of the repo client where the Git working directory for this project
214should be placed. If not supplied the project name is used.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800215If the project has a parent element, its path will be prefixed
216by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800217
218Attribute `remote`: Name of a previously defined remote element.
219If not supplied the remote given by the default element is used.
220
221Attribute `revision`: Name of the Git branch the manifest wants
222to track for this project. Names can be relative to refs/heads
223(e.g. just "master") or absolute (e.g. "refs/heads/master").
224Tags and/or explicit SHA-1s should work in theory, but have not
225been extensively tested. If not supplied the revision given by
Anthony King36ea2fb2014-05-06 11:54:01 +0100226the remote element is used if applicable, else the default
227element is used.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800228
Bryan Jacobsf609f912013-05-06 13:36:24 -0400229Attribute `dest-branch`: Name of a Git branch (e.g. `master`).
230When using `repo upload`, changes will be submitted for code
231review on this branch. If unspecified both here and in the
232default element, `revision` is used instead.
233
Colin Cross5acde752012-03-28 20:15:45 -0700234Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700235whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700236"all", and each project automatically belongs to a group of
237its name:`name` and path:`path`. E.g. for
Brian Harring7da13142012-06-15 02:24:20 -0700238<project name="monkeys" path="barrel-of"/>, that project
239definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700240default, name:monkeys, and path:barrel-of. If you place a project in the
241group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800242If the project has a parent element, the `name` and `path` here
243are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700244
Mani Chandel7a91d512014-07-24 16:27:08 +0530245Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900246branch (specified in the `revision` attribute) rather than the
247whole ref space.
248
Mani Chandel7a91d512014-07-24 16:27:08 +0530249Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900250
Nasser Grainawi909d58b2014-09-19 12:13:04 -0600251Attribute `upstream`: Name of the Git ref in which a sha1
David Pursehouse4e465202012-11-27 22:20:10 +0900252can be found. Used when syncing a revision locked manifest in
253-c mode to avoid having to sync the entire ref space.
254
David Pursehouseede7f122012-11-27 22:25:30 +0900255Attribute `clone-depth`: Set the depth to use when fetching this
256project. If specified, this value will override any value given
257to repo init with the --depth option on the command line.
258
Scott Fandb83b1b2013-02-28 09:34:14 +0800259Attribute `force-path`: Set to true to force this project to create the
260local mirror repository according to its `path` attribute (if supplied)
261rather than the `name` attribute. This attribute only applies to the
262local mirrors syncing, it will be ignored when syncing the projects in a
263client working directory.
264
Josh Triplett884a3872014-06-12 14:57:29 -0700265Element extend-project
266----------------------
267
268Modify the attributes of the named project.
269
270This element is mostly useful in a local manifest file, to modify the
271attributes of an existing project without completely replacing the
272existing project definition. This makes the local manifest more robust
273against changes to the original manifest.
274
275Attribute `path`: If specified, limit the change to projects checked out
276at the specified path, rather than all projects with the given name.
277
278Attribute `groups`: List of additional groups to which this project
279belongs. Same syntax as the corresponding element of `project`.
280
James W. Mills24c13082012-04-12 15:04:13 -0500281Element annotation
282------------------
283
284Zero or more annotation elements may be specified as children of a
285project element. Each element describes a name-value pair that will be
286exported into each project's environment during a 'forall' command,
287prefixed with REPO__. In addition, there is an optional attribute
288"keep" which accepts the case insensitive values "true" (default) or
289"false". This attribute determines whether or not the annotation will
290be kept when exported with the manifest subcommand.
291
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800292Element remove-project
293----------------------
294
295Deletes the named project from the internal manifest table, possibly
296allowing a subsequent project element in the same manifest file to
297replace the project with a different source.
298
David Pursehouseb1525bf2012-11-14 08:51:38 +0900299This element is mostly useful in a local manifest file, where
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800300the user can remove a project, and possibly replace it with their
301own definition.
302
Brian Harring26448742011-04-28 05:04:41 -0700303Element include
304---------------
305
306This element provides the capability of including another manifest
307file into the originating manifest. Normal rules apply for the
David Pursehouse9f3406e2012-11-14 08:52:25 +0900308target manifest to include - it must be a usable manifest on its own.
Brian Harring26448742011-04-28 05:04:41 -0700309
David Pursehouse9f3406e2012-11-14 08:52:25 +0900310Attribute `name`: the manifest to include, specified relative to
311the manifest repository's root.
Brian Harring26448742011-04-28 05:04:41 -0700312
Jimmie Wester38e43872012-10-24 14:35:05 +0200313Element projecthook
314-------------------
315
316This element is used to define a per-remote hook git that is
317fetched and applied to all projects using the remote. The project-
318hook functionality allows for company/team .git/hooks to be used.
319The hooks in the supplied project and revision are supplemented to
320the current repo stock hooks for each project. Supplemented hooks
321overrule any stock hooks.
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800322
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900323Local Manifests
324===============
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800325
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900326Additional remotes and projects may be added through local manifest
327files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800328
329For example:
330
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900331 $ ls .repo/local_manifests
332 local_manifest.xml
333 another_local_manifest.xml
334
335 $ cat .repo/local_manifests/local_manifest.xml
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800336 <?xml version="1.0" encoding="UTF-8"?>
337 <manifest>
338 <project path="manifest"
339 name="tools/manifest" />
340 <project path="platform-manifest"
341 name="platform/manifest" />
342 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800343
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900344Users may add projects to the local manifest(s) prior to a `repo sync`
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800345invocation, instructing repo to automatically download and manage
346these extra projects.
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900347
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900348Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
349be loaded in alphabetical order.
350
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900351Additional remotes and projects may also be added through a local
David Pursehouse5566ae52012-11-13 03:04:18 +0900352manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method
353is deprecated in favor of using multiple manifest files as mentioned
354above.
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900355
356If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before
357any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.