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