blob: f4629a55df478385acf291e40e6111014131035f [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
Doug Anderson2b8db3c2010-11-01 15:08:06 -070023
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*,
29 repo-hooks?)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080030
Doug Anderson2b8db3c2010-11-01 15:08:06 -070031
32
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080033
34
Yestin Sunb292b982012-07-02 07:32:50 -070035
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080036
37
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080038
39
40
41
Shawn O. Pearce6392c872011-09-22 17:44:31 -070042
Anatol Pomazau79770d22012-04-20 14:41:59 -070043
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +080044
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070045
46
47
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080048
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +080049
50 project*)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080051
52
53
54
Colin Cross5acde752012-03-28 20:15:45 -070055
Anatol Pomazau79770d22012-04-20 14:41:59 -070056
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +080057
David Pursehouse4e465202012-11-27 22:20:10 +090058
David Pursehouseede7f122012-11-27 22:25:30 +090059
James W. Mills24c13082012-04-12 15:04:13 -050060
61
62
63
64
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080065
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080066
67
Doug Anderson37282b42011-03-04 11:54:18 -080068
69
70
71
Brian Harring26448742011-04-28 05:04:41 -070072
73
74
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080075 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080076
77A description of the elements and their attributes follows.
78
79
80Element manifest
81----------------
82
83The root element of the file.
84
85
86Element remote
87--------------
88
89One or more remote elements may be specified. Each remote element
90specifies a Git URL shared by one or more projects and (optionally)
91the Gerrit review server those projects upload changes through.
92
93Attribute `name`: A short name unique to this manifest file. The
94name specified here is used as the remote name in each project's
95.git/config, and is therefore automatically available to commands
96like `git fetch`, `git remote`, `git pull` and `git push`.
97
Yestin Sunb292b982012-07-02 07:32:50 -070098Attribute `alias`: The alias, if specified, is used to override
99`name` to be set as the remote name in each project's .git/config.
100Its value can be duplicated while attribute `name` has to be unique
101in the manifest file. This helps each project to be able to have
102same remote name which actually points to different remote url.
103
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800104Attribute `fetch`: The Git URL prefix for all projects which use
105this remote. Each project's name is appended to this prefix to
106form the actual URL used to clone the project.
107
108Attribute `review`: Hostname of the Gerrit server where reviews
109are uploaded to by `repo upload`. This attribute is optional;
110if not specified then `repo upload` will not function.
111
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800112Element default
113---------------
114
115At most one default element may be specified. Its remote and
116revision attributes are used when a project element does not
117specify its own remote or revision attribute.
118
119Attribute `remote`: Name of a previously defined remote element.
120Project elements lacking a remote attribute of their own will use
121this remote.
122
123Attribute `revision`: Name of a Git branch (e.g. `master` or
124`refs/heads/master`). Project elements lacking their own
125revision attribute will use this revision.
126
David Pursehouse4e465202012-11-27 22:20:10 +0900127Attribute `sync_j`: Number of parallel jobs to use when synching.
128
129Attribute `sync_c`: Set to true to only sync the given Git
130branch (specified in the `revision` attribute) rather than the
131whole ref space. Project elements lacking a sync_c element of
132their own will use this value.
133
134Attribute `sync_s`: Set to true to also sync sub-projects.
135
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800136
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700137Element manifest-server
138-----------------------
139
140At most one manifest-server may be specified. The url attribute
141is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900142XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700143
David Pursehouse9a27d012012-08-21 14:23:49 +0900144The manifest server should implement the following RPC methods:
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700145
146 GetApprovedManifest(branch, target)
147
David Pursehouse9a27d012012-08-21 14:23:49 +0900148Return a manifest in which each project is pegged to a known good revision
149for the current branch and target.
150
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700151The target to use is defined by environment variables TARGET_PRODUCT
152and TARGET_BUILD_VARIANT. These variables are used to create a string
153of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
154If one of those variables or both are not present, the program will call
David Pursehousedaa851f2012-08-21 13:52:18 +0900155GetApprovedManifest without the target parameter and the manifest server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700156should choose a reasonable default target.
157
David Pursehouse9a27d012012-08-21 14:23:49 +0900158 GetManifest(tag)
159
160Return a manifest in which each project is pegged to the revision at
161the specified tag.
162
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700163
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800164Element project
165---------------
166
167One or more project elements may be specified. Each element
168describes a single Git repository to be cloned into the repo
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800169client workspace. You may specify Git-submodules by creating a
170nested project. Git-submodules will be automatically
171recognized and inherit their parent's attributes, but those
172may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800173
174Attribute `name`: A unique name for this project. The project's
175name is appended onto its remote's fetch URL to generate the actual
176URL to configure the Git remote with. The URL gets formed as:
177
178 ${remote_fetch}/${project_name}.git
179
180where ${remote_fetch} is the remote's fetch attribute and
181${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900182is always appended as repo assumes the upstream is a forest of
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800183bare Git repositories. If the project has a parent element, its
184name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800185
186The project name must match the name Gerrit knows, if Gerrit is
187being used for code reviews.
188
189Attribute `path`: An optional path relative to the top directory
190of the repo client where the Git working directory for this project
191should be placed. If not supplied the project name is used.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800192If the project has a parent element, its path will be prefixed
193by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800194
195Attribute `remote`: Name of a previously defined remote element.
196If not supplied the remote given by the default element is used.
197
198Attribute `revision`: Name of the Git branch the manifest wants
199to track for this project. Names can be relative to refs/heads
200(e.g. just "master") or absolute (e.g. "refs/heads/master").
201Tags and/or explicit SHA-1s should work in theory, but have not
202been extensively tested. If not supplied the revision given by
203the default element is used.
204
Colin Cross5acde752012-03-28 20:15:45 -0700205Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700206whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700207"all", and each project automatically belongs to a group of
208its name:`name` and path:`path`. E.g. for
Brian Harring7da13142012-06-15 02:24:20 -0700209, that project
210definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700211default, name:monkeys, and path:barrel-of. If you place a project in the
212group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800213If the project has a parent element, the `name` and `path` here
214are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700215
David Pursehouse4e465202012-11-27 22:20:10 +0900216Attribute `sync_c`: Set to true to only sync the given Git
217branch (specified in the `revision` attribute) rather than the
218whole ref space.
219
220Attribute `sync_s`: Set to true to also sync sub-projects.
221
222Attribute `upstream`: Name of the Git branch in which a sha1
223can be found. Used when syncing a revision locked manifest in
224-c mode to avoid having to sync the entire ref space.
225
David Pursehouseede7f122012-11-27 22:25:30 +0900226Attribute `clone-depth`: Set the depth to use when fetching this
227project. If specified, this value will override any value given
228to repo init with the --depth option on the command line.
229
James W. Mills24c13082012-04-12 15:04:13 -0500230Element annotation
231------------------
232
233Zero or more annotation elements may be specified as children of a
234project element. Each element describes a name-value pair that will be
235exported into each project's environment during a 'forall' command,
236prefixed with REPO__. In addition, there is an optional attribute
237"keep" which accepts the case insensitive values "true" (default) or
238"false". This attribute determines whether or not the annotation will
239be kept when exported with the manifest subcommand.
240
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800241Element remove-project
242----------------------
243
244Deletes the named project from the internal manifest table, possibly
245allowing a subsequent project element in the same manifest file to
246replace the project with a different source.
247
David Pursehouseb1525bf2012-11-14 08:51:38 +0900248This element is mostly useful in a local manifest file, where
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800249the user can remove a project, and possibly replace it with their
250own definition.
251
Brian Harring26448742011-04-28 05:04:41 -0700252Element include
253---------------
254
255This element provides the capability of including another manifest
256file into the originating manifest. Normal rules apply for the
David Pursehouse9f3406e2012-11-14 08:52:25 +0900257target manifest to include - it must be a usable manifest on its own.
Brian Harring26448742011-04-28 05:04:41 -0700258
David Pursehouse9f3406e2012-11-14 08:52:25 +0900259Attribute `name`: the manifest to include, specified relative to
260the manifest repository's root.
Brian Harring26448742011-04-28 05:04:41 -0700261
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800262
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900263Local Manifests
264===============
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800265
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900266Additional remotes and projects may be added through local manifest
267files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800268
269For example:
270
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900271 $ ls .repo/local_manifests
272 local_manifest.xml
273 another_local_manifest.xml
274
275 $ cat .repo/local_manifests/local_manifest.xml
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800276
277
278
279 name="tools/manifest" />
280
281 name="platform/manifest" />
282
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800283
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900284Users may add projects to the local manifest(s) prior to a `repo sync`
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800285invocation, instructing repo to automatically download and manage
286these extra projects.
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900287
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900288Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
289be loaded in alphabetical order.
290
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900291Additional remotes and projects may also be added through a local
David Pursehouse5566ae52012-11-13 03:04:18 +0900292manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method
293is deprecated in favor of using multiple manifest files as mentioned
294above.
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900295
296If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before
297any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.