blob: 9f4585b8af674cf685e5603bfbe8e1f46f8ae326 [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>
35 <!ATTLIST remote fetch CDATA #REQUIRED>
36 <!ATTLIST remote review CDATA #IMPLIED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080037
38 <!ELEMENT default (EMPTY)>
39 <!ATTLIST default remote IDREF #IMPLIED>
40 <!ATTLIST default revision CDATA #IMPLIED>
Shawn O. Pearce6392c872011-09-22 17:44:31 -070041 <!ATTLIST default sync-j CDATA #IMPLIED>
Anatol Pomazau79770d22012-04-20 14:41:59 -070042 <!ATTLIST default sync-c CDATA #IMPLIED>
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070043
44 <!ELEMENT manifest-server (EMPTY)>
45 <!ATTLIST url CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080046
James W. Mills24c13082012-04-12 15:04:13 -050047 <!ELEMENT project (annotation?)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080048 <!ATTLIST project name CDATA #REQUIRED>
49 <!ATTLIST project path CDATA #IMPLIED>
50 <!ATTLIST project remote IDREF #IMPLIED>
51 <!ATTLIST project revision CDATA #IMPLIED>
Colin Cross5acde752012-03-28 20:15:45 -070052 <!ATTLIST project groups CDATA #IMPLIED>
Anatol Pomazau79770d22012-04-20 14:41:59 -070053 <!ATTLIST project sync-c CDATA #IMPLIED>
James W. Mills24c13082012-04-12 15:04:13 -050054
55 <!ELEMENT annotation (EMPTY)>
56 <!ATTLIST annotation name CDATA #REQUIRED>
57 <!ATTLIST annotation value CDATA #REQUIRED>
58 <!ATTLIST annotation keep CDATA "true">
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080059
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080060 <!ELEMENT remove-project (EMPTY)>
61 <!ATTLIST remove-project name CDATA #REQUIRED>
Doug Anderson37282b42011-03-04 11:54:18 -080062
63 <!ELEMENT repo-hooks (EMPTY)>
64 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
65 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Brian Harring26448742011-04-28 05:04:41 -070066
67 <!ELEMENT include (EMPTY)>
68 <!ATTLIST include name CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080069 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080070
71A description of the elements and their attributes follows.
72
73
74Element manifest
75----------------
76
77The root element of the file.
78
79
80Element remote
81--------------
82
83One or more remote elements may be specified. Each remote element
84specifies a Git URL shared by one or more projects and (optionally)
85the Gerrit review server those projects upload changes through.
86
87Attribute `name`: A short name unique to this manifest file. The
88name specified here is used as the remote name in each project's
89.git/config, and is therefore automatically available to commands
90like `git fetch`, `git remote`, `git pull` and `git push`.
91
92Attribute `fetch`: The Git URL prefix for all projects which use
93this remote. Each project's name is appended to this prefix to
94form the actual URL used to clone the project.
95
96Attribute `review`: Hostname of the Gerrit server where reviews
97are uploaded to by `repo upload`. This attribute is optional;
98if not specified then `repo upload` will not function.
99
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800100Element default
101---------------
102
103At most one default element may be specified. Its remote and
104revision attributes are used when a project element does not
105specify its own remote or revision attribute.
106
107Attribute `remote`: Name of a previously defined remote element.
108Project elements lacking a remote attribute of their own will use
109this remote.
110
111Attribute `revision`: Name of a Git branch (e.g. `master` or
112`refs/heads/master`). Project elements lacking their own
113revision attribute will use this revision.
114
115
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700116Element manifest-server
117-----------------------
118
119At most one manifest-server may be specified. The url attribute
120is used to specify the URL of a manifest server, which is an
121XML RPC service that will return a manifest in which each project
122is pegged to a known good revision for the current branch and
123target.
124
125The manifest server should implement:
126
127 GetApprovedManifest(branch, target)
128
129The target to use is defined by environment variables TARGET_PRODUCT
130and TARGET_BUILD_VARIANT. These variables are used to create a string
131of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
132If one of those variables or both are not present, the program will call
133GetApprovedManifest without the target paramater and the manifest server
134should choose a reasonable default target.
135
136
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800137Element project
138---------------
139
140One or more project elements may be specified. Each element
141describes a single Git repository to be cloned into the repo
142client workspace.
143
144Attribute `name`: A unique name for this project. The project's
145name is appended onto its remote's fetch URL to generate the actual
146URL to configure the Git remote with. The URL gets formed as:
147
148 ${remote_fetch}/${project_name}.git
149
150where ${remote_fetch} is the remote's fetch attribute and
151${project_name} is the project's name attribute. The suffix ".git"
152is always appended as repo assumes the upstream is a forrest of
153bare Git repositories.
154
155The project name must match the name Gerrit knows, if Gerrit is
156being used for code reviews.
157
158Attribute `path`: An optional path relative to the top directory
159of the repo client where the Git working directory for this project
160should be placed. If not supplied the project name is used.
161
162Attribute `remote`: Name of a previously defined remote element.
163If not supplied the remote given by the default element is used.
164
165Attribute `revision`: Name of the Git branch the manifest wants
166to track for this project. Names can be relative to refs/heads
167(e.g. just "master") or absolute (e.g. "refs/heads/master").
168Tags and/or explicit SHA-1s should work in theory, but have not
169been extensively tested. If not supplied the revision given by
170the default element is used.
171
Colin Cross5acde752012-03-28 20:15:45 -0700172Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700173whitespace or comma separated. All projects belong to the group
174"default".
Colin Cross5acde752012-03-28 20:15:45 -0700175
James W. Mills24c13082012-04-12 15:04:13 -0500176Element annotation
177------------------
178
179Zero or more annotation elements may be specified as children of a
180project element. Each element describes a name-value pair that will be
181exported into each project's environment during a 'forall' command,
182prefixed with REPO__. In addition, there is an optional attribute
183"keep" which accepts the case insensitive values "true" (default) or
184"false". This attribute determines whether or not the annotation will
185be kept when exported with the manifest subcommand.
186
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800187Element remove-project
188----------------------
189
190Deletes the named project from the internal manifest table, possibly
191allowing a subsequent project element in the same manifest file to
192replace the project with a different source.
193
194This element is mostly useful in the local_manifest.xml, where
195the user can remove a project, and possibly replace it with their
196own definition.
197
Brian Harring26448742011-04-28 05:04:41 -0700198Element include
199---------------
200
201This element provides the capability of including another manifest
202file into the originating manifest. Normal rules apply for the
203target manifest to include- it must be a usable manifest on it's own.
204
205Attribute `name`; the manifest to include, specified relative to
206the manifest repositories root.
207
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800208
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800209Local Manifest
210==============
211
212Additional remotes and projects may be added through a local
213manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`.
214
215For example:
216
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800217 $ cat .repo/local_manifest.xml
218 <?xml version="1.0" encoding="UTF-8"?>
219 <manifest>
220 <project path="manifest"
221 name="tools/manifest" />
222 <project path="platform-manifest"
223 name="platform/manifest" />
224 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800225
226Users may add projects to the local manifest prior to a `repo sync`
227invocation, instructing repo to automatically download and manage
228these extra projects.