blob: a7bb1561689d0c1f4c871d990d2cd0e36b2c7a12 [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>
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070042
43 <!ELEMENT manifest-server (EMPTY)>
44 <!ATTLIST url CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080045
Shawn O. Pearce242b5262009-05-19 13:00:29 -070046 <!ELEMENT project (EMPTY)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080047 <!ATTLIST project name CDATA #REQUIRED>
48 <!ATTLIST project path CDATA #IMPLIED>
49 <!ATTLIST project remote IDREF #IMPLIED>
50 <!ATTLIST project revision CDATA #IMPLIED>
Colin Cross5acde752012-03-28 20:15:45 -070051 <!ATTLIST project groups CDATA #IMPLIED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080052
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080053 <!ELEMENT remove-project (EMPTY)>
54 <!ATTLIST remove-project name CDATA #REQUIRED>
Doug Anderson37282b42011-03-04 11:54:18 -080055
56 <!ELEMENT repo-hooks (EMPTY)>
57 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
58 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080059 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080060
61A description of the elements and their attributes follows.
62
63
64Element manifest
65----------------
66
67The root element of the file.
68
69
70Element remote
71--------------
72
73One or more remote elements may be specified. Each remote element
74specifies a Git URL shared by one or more projects and (optionally)
75the Gerrit review server those projects upload changes through.
76
77Attribute `name`: A short name unique to this manifest file. The
78name specified here is used as the remote name in each project's
79.git/config, and is therefore automatically available to commands
80like `git fetch`, `git remote`, `git pull` and `git push`.
81
82Attribute `fetch`: The Git URL prefix for all projects which use
83this remote. Each project's name is appended to this prefix to
84form the actual URL used to clone the project.
85
86Attribute `review`: Hostname of the Gerrit server where reviews
87are uploaded to by `repo upload`. This attribute is optional;
88if not specified then `repo upload` will not function.
89
Shawn O. Pearce3e548192008-11-04 11:19:36 -080090Element default
91---------------
92
93At most one default element may be specified. Its remote and
94revision attributes are used when a project element does not
95specify its own remote or revision attribute.
96
97Attribute `remote`: Name of a previously defined remote element.
98Project elements lacking a remote attribute of their own will use
99this remote.
100
101Attribute `revision`: Name of a Git branch (e.g. `master` or
102`refs/heads/master`). Project elements lacking their own
103revision attribute will use this revision.
104
105
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700106Element manifest-server
107-----------------------
108
109At most one manifest-server may be specified. The url attribute
110is used to specify the URL of a manifest server, which is an
111XML RPC service that will return a manifest in which each project
112is pegged to a known good revision for the current branch and
113target.
114
115The manifest server should implement:
116
117 GetApprovedManifest(branch, target)
118
119The target to use is defined by environment variables TARGET_PRODUCT
120and TARGET_BUILD_VARIANT. These variables are used to create a string
121of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
122If one of those variables or both are not present, the program will call
123GetApprovedManifest without the target paramater and the manifest server
124should choose a reasonable default target.
125
126
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800127Element project
128---------------
129
130One or more project elements may be specified. Each element
131describes a single Git repository to be cloned into the repo
132client workspace.
133
134Attribute `name`: A unique name for this project. The project's
135name is appended onto its remote's fetch URL to generate the actual
136URL to configure the Git remote with. The URL gets formed as:
137
138 ${remote_fetch}/${project_name}.git
139
140where ${remote_fetch} is the remote's fetch attribute and
141${project_name} is the project's name attribute. The suffix ".git"
142is always appended as repo assumes the upstream is a forrest of
143bare Git repositories.
144
145The project name must match the name Gerrit knows, if Gerrit is
146being used for code reviews.
147
148Attribute `path`: An optional path relative to the top directory
149of the repo client where the Git working directory for this project
150should be placed. If not supplied the project name is used.
151
152Attribute `remote`: Name of a previously defined remote element.
153If not supplied the remote given by the default element is used.
154
155Attribute `revision`: Name of the Git branch the manifest wants
156to track for this project. Names can be relative to refs/heads
157(e.g. just "master") or absolute (e.g. "refs/heads/master").
158Tags and/or explicit SHA-1s should work in theory, but have not
159been extensively tested. If not supplied the revision given by
160the default element is used.
161
Colin Cross5acde752012-03-28 20:15:45 -0700162Attribute `groups`: List of groups to which this project belongs,
163whitespace or comma separated. All projects are part of the group
164"default" unless "-default" is specified in the list of groups.
165
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800166Element remove-project
167----------------------
168
169Deletes the named project from the internal manifest table, possibly
170allowing a subsequent project element in the same manifest file to
171replace the project with a different source.
172
173This element is mostly useful in the local_manifest.xml, where
174the user can remove a project, and possibly replace it with their
175own definition.
176
177
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800178Local Manifest
179==============
180
181Additional remotes and projects may be added through a local
182manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`.
183
184For example:
185
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800186 $ cat .repo/local_manifest.xml
187 <?xml version="1.0" encoding="UTF-8"?>
188 <manifest>
189 <project path="manifest"
190 name="tools/manifest" />
191 <project path="platform-manifest"
192 name="platform/manifest" />
193 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800194
195Users may add projects to the local manifest prior to a `repo sync`
196invocation, instructing repo to automatically download and manage
197these extra projects.