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