blob: 5c014d6d40f5becc8e1dfaf84a90be02a77e5226 [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
22<!DOCTYPE manifest [
Shawn O. Pearce70939e22008-11-06 11:07:14 -080023 <!ELEMENT manifest (remote*,
24 default?,
25 project*,
26 add-remote*)>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080027
28 <!ELEMENT remote (EMPTY)>
Shawn O. Pearceae6e0942008-11-06 10:25:35 -080029 <!ATTLIST remote name ID #REQUIRED>
30 <!ATTLIST remote fetch CDATA #REQUIRED>
31 <!ATTLIST remote review CDATA #IMPLIED>
32 <!ATTLIST remote project-name CDATA #IMPLIED>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080033
34 <!ELEMENT default (EMPTY)>
35 <!ATTLIST default remote IDREF #IMPLIED>
36 <!ATTLIST default revision CDATA #IMPLIED>
37
38 <!ELEMENT project (remote*)>
39 <!ATTLIST project name CDATA #REQUIRED>
40 <!ATTLIST project path CDATA #IMPLIED>
41 <!ATTLIST project remote IDREF #IMPLIED>
42 <!ATTLIST project revision CDATA #IMPLIED>
Shawn O. Pearce70939e22008-11-06 11:07:14 -080043
44 <!ELEMENT add-remote (EMPTY)>
45 <!ATTLIST add-remote to-project ID #REQUIRED>
46 <!ATTLIST add-remote name ID #REQUIRED>
47 <!ATTLIST add-remote fetch CDATA #REQUIRED>
48 <!ATTLIST add-remote review CDATA #IMPLIED>
49 <!ATTLIST add-remote project-name CDATA #IMPLIED>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080050]>
51
52A description of the elements and their attributes follows.
53
54
55Element manifest
56----------------
57
58The root element of the file.
59
60
61Element remote
62--------------
63
64One or more remote elements may be specified. Each remote element
65specifies a Git URL shared by one or more projects and (optionally)
66the Gerrit review server those projects upload changes through.
67
68Attribute `name`: A short name unique to this manifest file. The
69name specified here is used as the remote name in each project's
70.git/config, and is therefore automatically available to commands
71like `git fetch`, `git remote`, `git pull` and `git push`.
72
73Attribute `fetch`: The Git URL prefix for all projects which use
74this remote. Each project's name is appended to this prefix to
75form the actual URL used to clone the project.
76
77Attribute `review`: Hostname of the Gerrit server where reviews
78are uploaded to by `repo upload`. This attribute is optional;
79if not specified then `repo upload` will not function.
80
Shawn O. Pearceae6e0942008-11-06 10:25:35 -080081Attribute `project-name`: Specifies the name of this project used
82by the review server given in the review attribute of this element.
83Only permitted when the remote element is nested inside of a project
84element (see below). If not given, defaults to the name supplied
85in the project's name attribute.
86
Shawn O. Pearce70939e22008-11-06 11:07:14 -080087Element add-remote
88------------------
89
90Adds a remote to an existing project, whose name is given by the
91to-project attribute. This is functionally equivalent to nesting
92a remote element under the project, but has the advantage that it
93can be specified in the uesr's `local_manifest.xml` to add a remote
94to a project declared by the normal manifest.
95
96The element can be used to add a fork of an existing project that
97the user needs to work with.
98
Shawn O. Pearce3e548192008-11-04 11:19:36 -080099
100Element default
101---------------
102
103At most one default element may be specified. Its remote and
104revision attributes are used when a project element does not
105specify its own remote or revision attribute.
106
107Attribute `remote`: Name of a previously defined remote element.
108Project elements lacking a remote attribute of their own will use
109this remote.
110
111Attribute `revision`: Name of a Git branch (e.g. `master` or
112`refs/heads/master`). Project elements lacking their own
113revision attribute will use this revision.
114
115
116Element project
117---------------
118
119One or more project elements may be specified. Each element
120describes a single Git repository to be cloned into the repo
121client workspace.
122
123Attribute `name`: A unique name for this project. The project's
124name is appended onto its remote's fetch URL to generate the actual
125URL to configure the Git remote with. The URL gets formed as:
126
127 ${remote_fetch}/${project_name}.git
128
129where ${remote_fetch} is the remote's fetch attribute and
130${project_name} is the project's name attribute. The suffix ".git"
131is always appended as repo assumes the upstream is a forrest of
132bare Git repositories.
133
134The project name must match the name Gerrit knows, if Gerrit is
135being used for code reviews.
136
137Attribute `path`: An optional path relative to the top directory
138of the repo client where the Git working directory for this project
139should be placed. If not supplied the project name is used.
140
141Attribute `remote`: Name of a previously defined remote element.
142If not supplied the remote given by the default element is used.
143
144Attribute `revision`: Name of the Git branch the manifest wants
145to track for this project. Names can be relative to refs/heads
146(e.g. just "master") or absolute (e.g. "refs/heads/master").
147Tags and/or explicit SHA-1s should work in theory, but have not
148been extensively tested. If not supplied the revision given by
149the default element is used.
150
151Child element `remote`: Described like the top-level remote element,
152but adds an additional remote to only this project. These additional
153remotes are fetched from first on the initial `repo sync`, causing
154the majority of the project's object database to be obtained through
155these additional remotes.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800156
157
158Local Manifest
159==============
160
161Additional remotes and projects may be added through a local
162manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`.
163
164For example:
165
166----
167 $ cat .repo/local_manifest.xml
168 <?xml version="1.0" encoding="UTF-8"?>
169 <manifest>
170 <project path="manifest"
171 name="tools/manifest" />
172 <project path="platform-manifest"
173 name="platform/manifest" />
174 </manifest>
175----
176
177Users may add projects to the local manifest prior to a `repo sync`
178invocation, instructing repo to automatically download and manage
179these extra projects.
180
181Currently the only supported feature of a local manifest is to
182add new remotes and/or projects. In the future a local manifest
183may support picking different revisions of a project, or deleting
184projects specified in the default manifest.