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