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