blob: 537896510a3b8f197df6a0135a23d24256953b9b [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>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080066 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080067
68A description of the elements and their attributes follows.
69
70
71Element manifest
72----------------
73
74The root element of the file.
75
76
77Element remote
78--------------
79
80One or more remote elements may be specified. Each remote element
81specifies a Git URL shared by one or more projects and (optionally)
82the Gerrit review server those projects upload changes through.
83
84Attribute `name`: A short name unique to this manifest file. The
85name specified here is used as the remote name in each project's
86.git/config, and is therefore automatically available to commands
87like `git fetch`, `git remote`, `git pull` and `git push`.
88
89Attribute `fetch`: The Git URL prefix for all projects which use
90this remote. Each project's name is appended to this prefix to
91form the actual URL used to clone the project.
92
93Attribute `review`: Hostname of the Gerrit server where reviews
94are uploaded to by `repo upload`. This attribute is optional;
95if not specified then `repo upload` will not function.
96
Shawn O. Pearce3e548192008-11-04 11:19:36 -080097Element default
98---------------
99
100At most one default element may be specified. Its remote and
101revision attributes are used when a project element does not
102specify its own remote or revision attribute.
103
104Attribute `remote`: Name of a previously defined remote element.
105Project elements lacking a remote attribute of their own will use
106this remote.
107
108Attribute `revision`: Name of a Git branch (e.g. `master` or
109`refs/heads/master`). Project elements lacking their own
110revision attribute will use this revision.
111
112
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700113Element manifest-server
114-----------------------
115
116At most one manifest-server may be specified. The url attribute
117is used to specify the URL of a manifest server, which is an
118XML RPC service that will return a manifest in which each project
119is pegged to a known good revision for the current branch and
120target.
121
122The manifest server should implement:
123
124 GetApprovedManifest(branch, target)
125
126The target to use is defined by environment variables TARGET_PRODUCT
127and TARGET_BUILD_VARIANT. These variables are used to create a string
128of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
129If one of those variables or both are not present, the program will call
130GetApprovedManifest without the target paramater and the manifest server
131should choose a reasonable default target.
132
133
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800134Element project
135---------------
136
137One or more project elements may be specified. Each element
138describes a single Git repository to be cloned into the repo
139client workspace.
140
141Attribute `name`: A unique name for this project. The project's
142name is appended onto its remote's fetch URL to generate the actual
143URL to configure the Git remote with. The URL gets formed as:
144
145 ${remote_fetch}/${project_name}.git
146
147where ${remote_fetch} is the remote's fetch attribute and
148${project_name} is the project's name attribute. The suffix ".git"
149is always appended as repo assumes the upstream is a forrest of
150bare Git repositories.
151
152The project name must match the name Gerrit knows, if Gerrit is
153being used for code reviews.
154
155Attribute `path`: An optional path relative to the top directory
156of the repo client where the Git working directory for this project
157should be placed. If not supplied the project name is used.
158
159Attribute `remote`: Name of a previously defined remote element.
160If not supplied the remote given by the default element is used.
161
162Attribute `revision`: Name of the Git branch the manifest wants
163to track for this project. Names can be relative to refs/heads
164(e.g. just "master") or absolute (e.g. "refs/heads/master").
165Tags and/or explicit SHA-1s should work in theory, but have not
166been extensively tested. If not supplied the revision given by
167the default element is used.
168
Colin Cross5acde752012-03-28 20:15:45 -0700169Attribute `groups`: List of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700170whitespace or comma separated. All projects belong to the group
171"default".
Colin Cross5acde752012-03-28 20:15:45 -0700172
James W. Mills24c13082012-04-12 15:04:13 -0500173Element annotation
174------------------
175
176Zero or more annotation elements may be specified as children of a
177project element. Each element describes a name-value pair that will be
178exported into each project's environment during a 'forall' command,
179prefixed with REPO__. In addition, there is an optional attribute
180"keep" which accepts the case insensitive values "true" (default) or
181"false". This attribute determines whether or not the annotation will
182be kept when exported with the manifest subcommand.
183
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800184Element remove-project
185----------------------
186
187Deletes the named project from the internal manifest table, possibly
188allowing a subsequent project element in the same manifest file to
189replace the project with a different source.
190
191This element is mostly useful in the local_manifest.xml, where
192the user can remove a project, and possibly replace it with their
193own definition.
194
195
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800196Local Manifest
197==============
198
199Additional remotes and projects may be added through a local
200manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`.
201
202For example:
203
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800204 $ cat .repo/local_manifest.xml
205 <?xml version="1.0" encoding="UTF-8"?>
206 <manifest>
207 <project path="manifest"
208 name="tools/manifest" />
209 <project path="platform-manifest"
210 name="platform/manifest" />
211 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800212
213Users may add projects to the local manifest prior to a `repo sync`
214invocation, instructing repo to automatically download and manage
215these extra projects.