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