blob: 59f6a2fd5404212a9cdb0f00341f2f3a995a92a7 [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*,
29 repo-hooks?)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080030
Doug Anderson2b8db3c2010-11-01 15:08:06 -070031 <!ELEMENT notice (#PCDATA)>
32
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080033 <!ELEMENT remote (EMPTY)>
34 <!ATTLIST remote name ID #REQUIRED>
Yestin Sunb292b982012-07-02 07:32:50 -070035 <!ATTLIST remote alias CDATA #IMPLIED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080036 <!ATTLIST remote fetch CDATA #REQUIRED>
37 <!ATTLIST remote review CDATA #IMPLIED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080038
39 <!ELEMENT default (EMPTY)>
40 <!ATTLIST default remote IDREF #IMPLIED>
41 <!ATTLIST default revision CDATA #IMPLIED>
Shawn O. Pearce6392c872011-09-22 17:44:31 -070042 <!ATTLIST default sync-j CDATA #IMPLIED>
Anatol Pomazau79770d22012-04-20 14:41:59 -070043 <!ATTLIST default sync-c CDATA #IMPLIED>
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +080044 <!ATTLIST default sync-s CDATA #IMPLIED>
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070045
46 <!ELEMENT manifest-server (EMPTY)>
47 <!ATTLIST url CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080048
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +080049 <!ELEMENT project (annotation?,
50 project*)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080051 <!ATTLIST project name CDATA #REQUIRED>
52 <!ATTLIST project path CDATA #IMPLIED>
53 <!ATTLIST project remote IDREF #IMPLIED>
54 <!ATTLIST project revision CDATA #IMPLIED>
Colin Cross5acde752012-03-28 20:15:45 -070055 <!ATTLIST project groups CDATA #IMPLIED>
Anatol Pomazau79770d22012-04-20 14:41:59 -070056 <!ATTLIST project sync-c CDATA #IMPLIED>
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +080057 <!ATTLIST project sync-s CDATA #IMPLIED>
David Pursehouse4e465202012-11-27 22:20:10 +090058 <!ATTLIST project upstream CDATA #IMPLIED>
David Pursehouseede7f122012-11-27 22:25:30 +090059 <!ATTLIST project clone-depth CDATA #IMPLIED>
Scott Fandb83b1b2013-02-28 09:34:14 +080060 <!ATTLIST project force-path CDATA #IMPLIED>
James W. Mills24c13082012-04-12 15:04:13 -050061
62 <!ELEMENT annotation (EMPTY)>
63 <!ATTLIST annotation name CDATA #REQUIRED>
64 <!ATTLIST annotation value CDATA #REQUIRED>
65 <!ATTLIST annotation keep CDATA "true">
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080066
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080067 <!ELEMENT remove-project (EMPTY)>
68 <!ATTLIST remove-project name CDATA #REQUIRED>
Doug Anderson37282b42011-03-04 11:54:18 -080069
70 <!ELEMENT repo-hooks (EMPTY)>
71 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
72 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Brian Harring26448742011-04-28 05:04:41 -070073
74 <!ELEMENT include (EMPTY)>
75 <!ATTLIST include name CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080076 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080077
78A description of the elements and their attributes follows.
79
80
81Element manifest
82----------------
83
84The root element of the file.
85
86
87Element remote
88--------------
89
90One or more remote elements may be specified. Each remote element
91specifies a Git URL shared by one or more projects and (optionally)
92the Gerrit review server those projects upload changes through.
93
94Attribute `name`: A short name unique to this manifest file. The
95name specified here is used as the remote name in each project's
96.git/config, and is therefore automatically available to commands
97like `git fetch`, `git remote`, `git pull` and `git push`.
98
Yestin Sunb292b982012-07-02 07:32:50 -070099Attribute `alias`: The alias, if specified, is used to override
100`name` to be set as the remote name in each project's .git/config.
101Its value can be duplicated while attribute `name` has to be unique
102in the manifest file. This helps each project to be able to have
103same remote name which actually points to different remote url.
104
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800105Attribute `fetch`: The Git URL prefix for all projects which use
106this remote. Each project's name is appended to this prefix to
107form the actual URL used to clone the project.
108
109Attribute `review`: Hostname of the Gerrit server where reviews
110are uploaded to by `repo upload`. This attribute is optional;
111if not specified then `repo upload` will not function.
112
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800113Element default
114---------------
115
116At most one default element may be specified. Its remote and
117revision attributes are used when a project element does not
118specify its own remote or revision attribute.
119
120Attribute `remote`: Name of a previously defined remote element.
121Project elements lacking a remote attribute of their own will use
122this remote.
123
124Attribute `revision`: Name of a Git branch (e.g. `master` or
125`refs/heads/master`). Project elements lacking their own
126revision attribute will use this revision.
127
David Pursehouse4e465202012-11-27 22:20:10 +0900128Attribute `sync_j`: Number of parallel jobs to use when synching.
129
130Attribute `sync_c`: Set to true to only sync the given Git
131branch (specified in the `revision` attribute) rather than the
132whole ref space. Project elements lacking a sync_c element of
133their own will use this value.
134
135Attribute `sync_s`: Set to true to also sync sub-projects.
136
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800137
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700138Element manifest-server
139-----------------------
140
141At most one manifest-server may be specified. The url attribute
142is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900143XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700144
David Pursehouse9a27d012012-08-21 14:23:49 +0900145The manifest server should implement the following RPC methods:
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700146
147 GetApprovedManifest(branch, target)
148
David Pursehouse9a27d012012-08-21 14:23:49 +0900149Return a manifest in which each project is pegged to a known good revision
150for the current branch and target.
151
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700152The target to use is defined by environment variables TARGET_PRODUCT
153and TARGET_BUILD_VARIANT. These variables are used to create a string
154of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
155If one of those variables or both are not present, the program will call
David Pursehousedaa851f2012-08-21 13:52:18 +0900156GetApprovedManifest without the target parameter and the manifest server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700157should choose a reasonable default target.
158
David Pursehouse9a27d012012-08-21 14:23:49 +0900159 GetManifest(tag)
160
161Return a manifest in which each project is pegged to the revision at
162the specified tag.
163
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700164
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800165Element project
166---------------
167
168One or more project elements may be specified. Each element
169describes a single Git repository to be cloned into the repo
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800170client workspace. You may specify Git-submodules by creating a
171nested project. Git-submodules will be automatically
172recognized and inherit their parent's attributes, but those
173may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800174
175Attribute `name`: A unique name for this project. The project's
176name is appended onto its remote's fetch URL to generate the actual
177URL to configure the Git remote with. The URL gets formed as:
178
179 ${remote_fetch}/${project_name}.git
180
181where ${remote_fetch} is the remote's fetch attribute and
182${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900183is always appended as repo assumes the upstream is a forest of
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800184bare Git repositories. If the project has a parent element, its
185name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800186
187The project name must match the name Gerrit knows, if Gerrit is
188being used for code reviews.
189
190Attribute `path`: An optional path relative to the top directory
191of the repo client where the Git working directory for this project
192should be placed. If not supplied the project name is used.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800193If the project has a parent element, its path will be prefixed
194by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800195
196Attribute `remote`: Name of a previously defined remote element.
197If not supplied the remote given by the default element is used.
198
199Attribute `revision`: Name of the Git branch the manifest wants
200to track for this project. Names can be relative to refs/heads
201(e.g. just "master") or absolute (e.g. "refs/heads/master").
202Tags and/or explicit SHA-1s should work in theory, but have not
203been extensively tested. If not supplied the revision given by
204the default element is used.
205
Colin Cross5acde752012-03-28 20:15:45 -0700206Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700207whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700208"all", and each project automatically belongs to a group of
209its name:`name` and path:`path`. E.g. for
Brian Harring7da13142012-06-15 02:24:20 -0700210<project name="monkeys" path="barrel-of"/>, that project
211definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700212default, name:monkeys, and path:barrel-of. If you place a project in the
213group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800214If the project has a parent element, the `name` and `path` here
215are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700216
David Pursehouse4e465202012-11-27 22:20:10 +0900217Attribute `sync_c`: Set to true to only sync the given Git
218branch (specified in the `revision` attribute) rather than the
219whole ref space.
220
221Attribute `sync_s`: Set to true to also sync sub-projects.
222
223Attribute `upstream`: Name of the Git branch in which a sha1
224can be found. Used when syncing a revision locked manifest in
225-c mode to avoid having to sync the entire ref space.
226
David Pursehouseede7f122012-11-27 22:25:30 +0900227Attribute `clone-depth`: Set the depth to use when fetching this
228project. If specified, this value will override any value given
229to repo init with the --depth option on the command line.
230
Scott Fandb83b1b2013-02-28 09:34:14 +0800231Attribute `force-path`: Set to true to force this project to create the
232local mirror repository according to its `path` attribute (if supplied)
233rather than the `name` attribute. This attribute only applies to the
234local mirrors syncing, it will be ignored when syncing the projects in a
235client working directory.
236
James W. Mills24c13082012-04-12 15:04:13 -0500237Element annotation
238------------------
239
240Zero or more annotation elements may be specified as children of a
241project element. Each element describes a name-value pair that will be
242exported into each project's environment during a 'forall' command,
243prefixed with REPO__. In addition, there is an optional attribute
244"keep" which accepts the case insensitive values "true" (default) or
245"false". This attribute determines whether or not the annotation will
246be kept when exported with the manifest subcommand.
247
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800248Element remove-project
249----------------------
250
251Deletes the named project from the internal manifest table, possibly
252allowing a subsequent project element in the same manifest file to
253replace the project with a different source.
254
David Pursehouseb1525bf2012-11-14 08:51:38 +0900255This element is mostly useful in a local manifest file, where
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800256the user can remove a project, and possibly replace it with their
257own definition.
258
Brian Harring26448742011-04-28 05:04:41 -0700259Element include
260---------------
261
262This element provides the capability of including another manifest
263file into the originating manifest. Normal rules apply for the
David Pursehouse9f3406e2012-11-14 08:52:25 +0900264target manifest to include - it must be a usable manifest on its own.
Brian Harring26448742011-04-28 05:04:41 -0700265
David Pursehouse9f3406e2012-11-14 08:52:25 +0900266Attribute `name`: the manifest to include, specified relative to
267the manifest repository's root.
Brian Harring26448742011-04-28 05:04:41 -0700268
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800269
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900270Local Manifests
271===============
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800272
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900273Additional remotes and projects may be added through local manifest
274files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800275
276For example:
277
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900278 $ ls .repo/local_manifests
279 local_manifest.xml
280 another_local_manifest.xml
281
282 $ cat .repo/local_manifests/local_manifest.xml
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800283 <?xml version="1.0" encoding="UTF-8"?>
284 <manifest>
285 <project path="manifest"
286 name="tools/manifest" />
287 <project path="platform-manifest"
288 name="platform/manifest" />
289 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800290
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900291Users may add projects to the local manifest(s) prior to a `repo sync`
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800292invocation, instructing repo to automatically download and manage
293these extra projects.
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900294
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900295Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
296be loaded in alphabetical order.
297
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900298Additional remotes and projects may also be added through a local
David Pursehouse5566ae52012-11-13 03:04:18 +0900299manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`. This method
300is deprecated in favor of using multiple manifest files as mentioned
301above.
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900302
303If `$TOP_DIR/.repo/local_manifest.xml` exists, it will be loaded before
304any manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.