blob: da0e69ff3f75d86572ba654e31d9241a00db14b6 [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?,
25 remove-project*,
Shawn O. Pearce242b5262009-05-19 13:00:29 -070026 project*)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080027
28 <!ELEMENT remote (EMPTY)>
29 <!ATTLIST remote name ID #REQUIRED>
30 <!ATTLIST remote fetch CDATA #REQUIRED>
31 <!ATTLIST remote review CDATA #IMPLIED>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080032
33 <!ELEMENT default (EMPTY)>
34 <!ATTLIST default remote IDREF #IMPLIED>
35 <!ATTLIST default revision CDATA #IMPLIED>
36
Shawn O. Pearce242b5262009-05-19 13:00:29 -070037 <!ELEMENT project (EMPTY)>
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080038 <!ATTLIST project name CDATA #REQUIRED>
39 <!ATTLIST project path CDATA #IMPLIED>
40 <!ATTLIST project remote IDREF #IMPLIED>
41 <!ATTLIST project revision CDATA #IMPLIED>
42
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -080043 <!ELEMENT remove-project (EMPTY)>
44 <!ATTLIST remove-project name CDATA #REQUIRED>
45 ]>
Shawn O. Pearce3e548192008-11-04 11:19:36 -080046
47A description of the elements and their attributes follows.
48
49
50Element manifest
51----------------
52
53The root element of the file.
54
55
56Element remote
57--------------
58
59One or more remote elements may be specified. Each remote element
60specifies a Git URL shared by one or more projects and (optionally)
61the Gerrit review server those projects upload changes through.
62
63Attribute `name`: A short name unique to this manifest file. The
64name specified here is used as the remote name in each project's
65.git/config, and is therefore automatically available to commands
66like `git fetch`, `git remote`, `git pull` and `git push`.
67
68Attribute `fetch`: The Git URL prefix for all projects which use
69this remote. Each project's name is appended to this prefix to
70form the actual URL used to clone the project.
71
72Attribute `review`: Hostname of the Gerrit server where reviews
73are uploaded to by `repo upload`. This attribute is optional;
74if not specified then `repo upload` will not function.
75
Shawn O. Pearce3e548192008-11-04 11:19:36 -080076Element default
77---------------
78
79At most one default element may be specified. Its remote and
80revision attributes are used when a project element does not
81specify its own remote or revision attribute.
82
83Attribute `remote`: Name of a previously defined remote element.
84Project elements lacking a remote attribute of their own will use
85this remote.
86
87Attribute `revision`: Name of a Git branch (e.g. `master` or
88`refs/heads/master`). Project elements lacking their own
89revision attribute will use this revision.
90
91
92Element project
93---------------
94
95One or more project elements may be specified. Each element
96describes a single Git repository to be cloned into the repo
97client workspace.
98
99Attribute `name`: A unique name for this project. The project's
100name is appended onto its remote's fetch URL to generate the actual
101URL to configure the Git remote with. The URL gets formed as:
102
103 ${remote_fetch}/${project_name}.git
104
105where ${remote_fetch} is the remote's fetch attribute and
106${project_name} is the project's name attribute. The suffix ".git"
107is always appended as repo assumes the upstream is a forrest of
108bare Git repositories.
109
110The project name must match the name Gerrit knows, if Gerrit is
111being used for code reviews.
112
113Attribute `path`: An optional path relative to the top directory
114of the repo client where the Git working directory for this project
115should be placed. If not supplied the project name is used.
116
117Attribute `remote`: Name of a previously defined remote element.
118If not supplied the remote given by the default element is used.
119
120Attribute `revision`: Name of the Git branch the manifest wants
121to track for this project. Names can be relative to refs/heads
122(e.g. just "master") or absolute (e.g. "refs/heads/master").
123Tags and/or explicit SHA-1s should work in theory, but have not
124been extensively tested. If not supplied the revision given by
125the default element is used.
126
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800127Element remove-project
128----------------------
129
130Deletes the named project from the internal manifest table, possibly
131allowing a subsequent project element in the same manifest file to
132replace the project with a different source.
133
134This element is mostly useful in the local_manifest.xml, where
135the user can remove a project, and possibly replace it with their
136own definition.
137
138
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800139Local Manifest
140==============
141
142Additional remotes and projects may be added through a local
143manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`.
144
145For example:
146
Shawn O. Pearce43c3d9e2009-03-04 14:26:50 -0800147 $ cat .repo/local_manifest.xml
148 <?xml version="1.0" encoding="UTF-8"?>
149 <manifest>
150 <project path="manifest"
151 name="tools/manifest" />
152 <project path="platform-manifest"
153 name="platform/manifest" />
154 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800155
156Users may add projects to the local manifest prior to a `repo sync`
157invocation, instructing repo to automatically download and manage
158these extra projects.