Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 1 | # repo Manifest Format |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 2 | |
| 3 | A repo manifest describes the structure of a repo client; that is |
| 4 | the directories that are visible and where they should be obtained |
| 5 | from with git. |
| 6 | |
| 7 | The basic structure of a manifest is a bare Git repository holding |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 8 | a single `default.xml` XML file in the top level directory. |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 9 | |
| 10 | Manifests are inherently version controlled, since they are kept |
| 11 | within a Git repository. Updates to manifests are automatically |
| 12 | obtained by clients during `repo sync`. |
| 13 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 14 | [TOC] |
| 15 | |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 16 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 17 | ## XML File Format |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 18 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 19 | A manifest XML file (e.g. `default.xml`) roughly conforms to the |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 20 | following DTD: |
| 21 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 22 | ```xml |
| 23 | |
Mike Frysinger | 0888a08 | 2021-04-13 20:22:01 -0400 | [diff] [blame] | 24 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 25 | |
| 26 | remote*, |
| 27 | default?, |
| 28 | manifest-server?, |
LaMont Jones | cc879a9 | 2021-11-18 22:40:18 +0000 | [diff] [blame^] | 29 | submanifest*?, |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 30 | remove-project*, |
| 31 | project*, |
| 32 | extend-project*, |
| 33 | repo-hooks?, |
Raman Tenneti | 1bb4fb2 | 2021-01-07 16:50:45 -0800 | [diff] [blame] | 34 | superproject?, |
Raman Tenneti | 1c3f57e | 2021-05-04 12:32:13 -0700 | [diff] [blame] | 35 | contactinfo?, |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 36 | include*)> |
Chirayu Desai | d5a5b19 | 2013-11-21 19:15:30 +0530 | [diff] [blame] | 37 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 38 | |
Chirayu Desai | d5a5b19 | 2013-11-21 19:15:30 +0530 | [diff] [blame] | 39 | |
Jack Neus | 6ea0cae | 2021-07-20 20:52:33 +0000 | [diff] [blame] | 40 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
Chirayu Desai | d5a5b19 | 2013-11-21 19:15:30 +0530 | [diff] [blame] | 47 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 57 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 58 | |
| 59 | |
Chirayu Desai | d5a5b19 | 2013-11-21 19:15:30 +0530 | [diff] [blame] | 60 | |
LaMont Jones | cc879a9 | 2021-11-18 22:40:18 +0000 | [diff] [blame^] | 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 70 | |
| 71 | project*, |
| 72 | copyfile*, |
| 73 | linkfile*)> |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
Kyunam Jo | 01019d9 | 2019-03-18 13:30:58 +0900 | [diff] [blame] | 82 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 83 | |
| 84 | |
| 85 | |
James W. Mills | 24c1308 | 2012-04-12 15:04:13 -0500 | [diff] [blame] | 86 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 87 | |
| 88 | |
| 89 | |
| 90 | |
Chirayu Desai | d5a5b19 | 2013-11-21 19:15:30 +0530 | [diff] [blame] | 91 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 92 | |
| 93 | |
| 94 | |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 95 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 96 | |
| 97 | |
| 98 | |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 99 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 100 | |
| 101 | |
| 102 | |
Michael Kelly | 37c21c2 | 2020-06-13 02:10:40 -0700 | [diff] [blame] | 103 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 104 | |
| 105 | |
Kyunam Jo | bd0aae9 | 2020-02-04 11:38:53 +0900 | [diff] [blame] | 106 | |
Josh Triplett | 884a387 | 2014-06-12 14:57:29 -0700 | [diff] [blame] | 107 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 108 | |
| 109 | |
Michael Kelly | 06da998 | 2021-06-30 01:58:28 -0700 | [diff] [blame] | 110 | |
Doug Anderson | 37282b4 | 2011-03-04 11:54:18 -0800 | [diff] [blame] | 111 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 112 | |
| 113 | |
| 114 | |
Brian Harring | 2644874 | 2011-04-28 05:04:41 -0700 | [diff] [blame] | 115 | |
Raman Tenneti | 1c3f57e | 2021-05-04 12:32:13 -0700 | [diff] [blame] | 116 | |
Xin Li | e0b16a2 | 2021-09-26 23:20:32 -0700 | [diff] [blame] | 117 | |
| 118 | |
| 119 | |
Raman Tenneti | 1bb4fb2 | 2021-01-07 16:50:45 -0800 | [diff] [blame] | 120 | |
Raman Tenneti | 1c3f57e | 2021-05-04 12:32:13 -0700 | [diff] [blame] | 121 | |
| 122 | |
| 123 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 124 | |
Fredrik de Groot | 352c93b | 2020-10-06 12:55:14 +0200 | [diff] [blame] | 125 | |
| 126 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 127 | ]> |
| 128 | ``` |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 129 | |
Raman Tenneti | 48b2d10 | 2021-01-11 12:18:47 -0800 | [diff] [blame] | 130 | For compatibility purposes across repo releases, all unknown elements are |
| 131 | silently ignored. However, repo reserves all possible names for itself for |
| 132 | future use. If you want to use custom elements, the `x-*` namespace is |
| 133 | reserved for that purpose, and repo guarantees to never allocate any |
| 134 | corresponding names. |
| 135 | |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 136 | A description of the elements and their attributes follows. |
| 137 | |
| 138 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 139 | ### Element manifest |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 140 | |
| 141 | The root element of the file. |
| 142 | |
Mike Frysinger | 51e39d5 | 2020-12-04 05:32:06 -0500 | [diff] [blame] | 143 | ### Element notice |
| 144 | |
| 145 | Arbitrary text that is displayed to users whenever `repo sync` finishes. |
| 146 | The content is simply passed through as it exists in the manifest. |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 147 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 148 | ### Element remote |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 149 | |
| 150 | One or more remote elements may be specified. Each remote element |
| 151 | specifies a Git URL shared by one or more projects and (optionally) |
| 152 | the Gerrit review server those projects upload changes through. |
| 153 | |
| 154 | Attribute `name`: A short name unique to this manifest file. The |
| 155 | name specified here is used as the remote name in each project's |
| 156 | .git/config, and is therefore automatically available to commands |
| 157 | like `git fetch`, `git remote`, `git pull` and `git push`. |
| 158 | |
Yestin Sun | b292b98 | 2012-07-02 07:32:50 -0700 | [diff] [blame] | 159 | Attribute `alias`: The alias, if specified, is used to override |
| 160 | `name` to be set as the remote name in each project's .git/config. |
| 161 | Its value can be duplicated while attribute `name` has to be unique |
| 162 | in the manifest file. This helps each project to be able to have |
| 163 | same remote name which actually points to different remote url. |
| 164 | |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 165 | Attribute `fetch`: The Git URL prefix for all projects which use |
| 166 | this remote. Each project's name is appended to this prefix to |
| 167 | form the actual URL used to clone the project. |
| 168 | |
Steve Rae | d648045 | 2016-08-10 15:00:00 -0700 | [diff] [blame] | 169 | Attribute `pushurl`: The Git "push" URL prefix for all projects |
| 170 | which use this remote. Each project's name is appended to this |
| 171 | prefix to form the actual URL used to "git push" the project. |
| 172 | This attribute is optional; if not specified then "git push" |
| 173 | will use the same URL as the `fetch` attribute. |
| 174 | |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 175 | Attribute `review`: Hostname of the Gerrit server where reviews |
| 176 | are uploaded to by `repo upload`. This attribute is optional; |
| 177 | if not specified then `repo upload` will not function. |
| 178 | |
Mike Frysinger | 6e89c96 | 2020-11-15 18:42:26 -0500 | [diff] [blame] | 179 | Attribute `revision`: Name of a Git branch (e.g. `main` or |
| 180 | `refs/heads/main`). Remotes with their own revision will override |
Anthony King | 36ea2fb | 2014-05-06 11:54:01 +0100 | [diff] [blame] | 181 | the default revision. |
| 182 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 183 | ### Element default |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 184 | |
| 185 | At most one default element may be specified. Its remote and |
| 186 | revision attributes are used when a project element does not |
| 187 | specify its own remote or revision attribute. |
| 188 | |
| 189 | Attribute `remote`: Name of a previously defined remote element. |
| 190 | Project elements lacking a remote attribute of their own will use |
| 191 | this remote. |
| 192 | |
Mike Frysinger | 6e89c96 | 2020-11-15 18:42:26 -0500 | [diff] [blame] | 193 | Attribute `revision`: Name of a Git branch (e.g. `main` or |
| 194 | `refs/heads/main`). Project elements lacking their own |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 195 | revision attribute will use this revision. |
| 196 | |
Mike Frysinger | 6e89c96 | 2020-11-15 18:42:26 -0500 | [diff] [blame] | 197 | Attribute `dest-branch`: Name of a Git branch (e.g. `main`). |
Bryan Jacobs | f609f91 | 2013-05-06 13:36:24 -0400 | [diff] [blame] | 198 | Project elements not setting their own `dest-branch` will inherit |
| 199 | this value. If this value is not set, projects will use `revision` |
| 200 | by default instead. |
| 201 | |
Nasser Grainawi | da40341 | 2018-05-04 12:53:29 -0600 | [diff] [blame] | 202 | Attribute `upstream`: Name of the Git ref in which a sha1 |
| 203 | can be found. Used when syncing a revision locked manifest in |
| 204 | -c mode to avoid having to sync the entire ref space. Project elements |
| 205 | not setting their own `upstream` will inherit this value. |
| 206 | |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 207 | Attribute `sync-j`: Number of parallel jobs to use when synching. |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 208 | |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 209 | Attribute `sync-c`: Set to true to only sync the given Git |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 210 | branch (specified in the `revision` attribute) rather than the |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 211 | whole ref space. Project elements lacking a sync-c element of |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 212 | their own will use this value. |
| 213 | |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 214 | Attribute `sync-s`: Set to true to also sync sub-projects. |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 215 | |
YOUNG HO CHA | a32c92c | 2018-02-14 16:57:31 +0900 | [diff] [blame] | 216 | Attribute `sync-tags`: Set to false to only sync the given Git |
| 217 | branch (specified in the `revision` attribute) rather than |
| 218 | the other ref tags. |
| 219 | |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 220 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 221 | ### Element manifest-server |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 222 | |
| 223 | At most one manifest-server may be specified. The url attribute |
| 224 | is used to specify the URL of a manifest server, which is an |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 225 | XML RPC service. |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 226 | |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 227 | The manifest server should implement the following RPC methods: |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 228 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 229 | GetApprovedManifest(branch, target) |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 230 | |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 231 | Return a manifest in which each project is pegged to a known good revision |
David Pursehouse | e868841 | 2016-04-13 17:55:34 +0900 | [diff] [blame] | 232 | for the current branch and target. This is used by repo sync when the |
| 233 | --smart-sync option is given. |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 234 | |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 235 | The target to use is defined by environment variables TARGET_PRODUCT |
| 236 | and TARGET_BUILD_VARIANT. These variables are used to create a string |
| 237 | of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug. |
| 238 | If one of those variables or both are not present, the program will call |
David Pursehouse | daa851f | 2012-08-21 13:52:18 +0900 | [diff] [blame] | 239 | GetApprovedManifest without the target parameter and the manifest server |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 240 | should choose a reasonable default target. |
| 241 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 242 | GetManifest(tag) |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 243 | |
| 244 | Return a manifest in which each project is pegged to the revision at |
David Pursehouse | e868841 | 2016-04-13 17:55:34 +0900 | [diff] [blame] | 245 | the specified tag. This is used by repo sync when the --smart-tag option |
| 246 | is given. |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 247 | |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 248 | |
LaMont Jones | cc879a9 | 2021-11-18 22:40:18 +0000 | [diff] [blame^] | 249 | ### Element submanifest |
| 250 | |
| 251 | One or more submanifest elements may be specified. Each element describes a |
| 252 | single manifest to be checked out as a child. |
| 253 | |
| 254 | Attribute `name`: A unique name (within the current (sub)manifest) for this |
| 255 | submanifest. It acts as a default for `revision` below. The same name can be |
| 256 | used for submanifests with different parent (sub)manifests. |
| 257 | |
| 258 | Attribute `remote`: Name of a previously defined remote element. |
| 259 | If not supplied the remote given by the default element is used. |
| 260 | |
| 261 | Attribute `project`: The manifest project name. The project's name is appended |
| 262 | onto its remote's fetch URL to generate the actual URL to configure the Git |
| 263 | remote with. The URL gets formed as: |
| 264 | |
| 265 | ${remote_fetch}/${project_name}.git |
| 266 | |
| 267 | where ${remote_fetch} is the remote's fetch attribute and |
| 268 | ${project_name} is the project's name attribute. The suffix ".git" |
| 269 | is always appended as repo assumes the upstream is a forest of |
| 270 | bare Git repositories. If the project has a parent element, its |
| 271 | name will be prefixed by the parent's. |
| 272 | |
| 273 | The project name must match the name Gerrit knows, if Gerrit is |
| 274 | being used for code reviews. |
| 275 | |
| 276 | `project` must not be empty, and may not be an absolute path or use "." or ".." |
| 277 | path components. It is always interpreted relative to the remote's fetch |
| 278 | settings, so if a different base path is needed, declare a different remote |
| 279 | with the new settings needed. |
| 280 | |
| 281 | If not supplied the remote and project for this manifest will be used: `remote` |
| 282 | cannot be supplied. |
| 283 | |
| 284 | Attribute `manifest-name`: The manifest filename in the manifest project. If |
| 285 | not supplied, `default.xml` is used. |
| 286 | |
| 287 | Attribute `revision`: Name of a Git branch (e.g. "main" or "refs/heads/main"), |
| 288 | tag (e.g. "refs/tags/stable"), or a commit hash. If not supplied, `name` is |
| 289 | used. |
| 290 | |
| 291 | Attribute `path`: An optional path relative to the top directory |
| 292 | of the repo client where the submanifest repo client top directory |
| 293 | should be placed. If not supplied, `revision` is used. |
| 294 | |
| 295 | `path` may not be an absolute path or use "." or ".." path components. |
| 296 | |
| 297 | Attribute `groups`: List of additional groups to which all projects |
| 298 | in the included submanifest belong. This appends and recurses, meaning |
| 299 | all projects in submanifests carry all parent submanifest groups. |
| 300 | Same syntax as the corresponding element of `project`. |
| 301 | |
| 302 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 303 | ### Element project |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 304 | |
| 305 | One or more project elements may be specified. Each element |
| 306 | describes a single Git repository to be cloned into the repo |
Che-Liang Chiou | b2bd91c | 2012-01-11 11:28:42 +0800 | [diff] [blame] | 307 | client workspace. You may specify Git-submodules by creating a |
| 308 | nested project. Git-submodules will be automatically |
| 309 | recognized and inherit their parent's attributes, but those |
| 310 | may be overridden by an explicitly specified project element. |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 311 | |
| 312 | Attribute `name`: A unique name for this project. The project's |
| 313 | name is appended onto its remote's fetch URL to generate the actual |
| 314 | URL to configure the Git remote with. The URL gets formed as: |
| 315 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 316 | ${remote_fetch}/${project_name}.git |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 317 | |
| 318 | where ${remote_fetch} is the remote's fetch attribute and |
| 319 | ${project_name} is the project's name attribute. The suffix ".git" |
David Pursehouse | daa851f | 2012-08-21 13:52:18 +0900 | [diff] [blame] | 320 | is always appended as repo assumes the upstream is a forest of |
Che-Liang Chiou | b2bd91c | 2012-01-11 11:28:42 +0800 | [diff] [blame] | 321 | bare Git repositories. If the project has a parent element, its |
| 322 | name will be prefixed by the parent's. |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 323 | |
| 324 | The project name must match the name Gerrit knows, if Gerrit is |
| 325 | being used for code reviews. |
| 326 | |
Mike Frysinger | 68d5d4d | 2021-03-09 11:56:24 -0500 | [diff] [blame] | 327 | "name" must not be empty, and may not be an absolute path or use "." or ".." |
| 328 | path components. It is always interpreted relative to the remote's fetch |
| 329 | settings, so if a different base path is needed, declare a different remote |
| 330 | with the new settings needed. |
| 331 | These restrictions are not enforced for [Local Manifests]. |
| 332 | |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 333 | Attribute `path`: An optional path relative to the top directory |
| 334 | of the repo client where the Git working directory for this project |
Mike Frysinger | 68d5d4d | 2021-03-09 11:56:24 -0500 | [diff] [blame] | 335 | should be placed. If not supplied the project "name" is used. |
Che-Liang Chiou | b2bd91c | 2012-01-11 11:28:42 +0800 | [diff] [blame] | 336 | If the project has a parent element, its path will be prefixed |
| 337 | by the parent's. |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 338 | |
Mike Frysinger | 68d5d4d | 2021-03-09 11:56:24 -0500 | [diff] [blame] | 339 | "path" may not be an absolute path or use "." or ".." path components. |
| 340 | These restrictions are not enforced for [Local Manifests]. |
| 341 | |
| 342 | If you want to place files into the root of the checkout (e.g. a README or |
| 343 | Makefile or another build script), use the [copyfile] or [linkfile] elements |
| 344 | instead. |
| 345 | |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 346 | Attribute `remote`: Name of a previously defined remote element. |
| 347 | If not supplied the remote given by the default element is used. |
| 348 | |
| 349 | Attribute `revision`: Name of the Git branch the manifest wants |
| 350 | to track for this project. Names can be relative to refs/heads |
Mike Frysinger | 6e89c96 | 2020-11-15 18:42:26 -0500 | [diff] [blame] | 351 | (e.g. just "main") or absolute (e.g. "refs/heads/main"). |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 352 | Tags and/or explicit SHA-1s should work in theory, but have not |
| 353 | been extensively tested. If not supplied the revision given by |
Anthony King | 36ea2fb | 2014-05-06 11:54:01 +0100 | [diff] [blame] | 354 | the remote element is used if applicable, else the default |
| 355 | element is used. |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 356 | |
Mike Frysinger | 6e89c96 | 2020-11-15 18:42:26 -0500 | [diff] [blame] | 357 | Attribute `dest-branch`: Name of a Git branch (e.g. `main`). |
Bryan Jacobs | f609f91 | 2013-05-06 13:36:24 -0400 | [diff] [blame] | 358 | When using `repo upload`, changes will be submitted for code |
| 359 | review on this branch. If unspecified both here and in the |
| 360 | default element, `revision` is used instead. |
| 361 | |
Colin Cross | 5acde75 | 2012-03-28 20:15:45 -0700 | [diff] [blame] | 362 | Attribute `groups`: List of groups to which this project belongs, |
Conley Owens | 971de8e | 2012-04-16 10:36:08 -0700 | [diff] [blame] | 363 | whitespace or comma separated. All projects belong to the group |
Conley Owens | bb1b5f5 | 2012-08-13 13:11:18 -0700 | [diff] [blame] | 364 | "all", and each project automatically belongs to a group of |
| 365 | its name:`name` and path:`path`. E.g. for |
Jashank Jeremy | 9747747 | 2020-12-12 20:50:22 +1100 | [diff] [blame] | 366 | ``, that project |
Brian Harring | 7da1314 | 2012-06-15 02:24:20 -0700 | [diff] [blame] | 367 | definition is implicitly in the following manifest groups: |
Conley Owens | bb1b5f5 | 2012-08-13 13:11:18 -0700 | [diff] [blame] | 368 | default, name:monkeys, and path:barrel-of. If you place a project in the |
| 369 | group "notdefault", it will not be automatically downloaded by repo. |
Che-Liang Chiou | b2bd91c | 2012-01-11 11:28:42 +0800 | [diff] [blame] | 370 | If the project has a parent element, the `name` and `path` here |
| 371 | are the prefixed ones. |
Colin Cross | 5acde75 | 2012-03-28 20:15:45 -0700 | [diff] [blame] | 372 | |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 373 | Attribute `sync-c`: Set to true to only sync the given Git |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 374 | branch (specified in the `revision` attribute) rather than the |
| 375 | whole ref space. |
| 376 | |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 377 | Attribute `sync-s`: Set to true to also sync sub-projects. |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 378 | |
Nasser Grainawi | 909d58b | 2014-09-19 12:13:04 -0600 | [diff] [blame] | 379 | Attribute `upstream`: Name of the Git ref in which a sha1 |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 380 | can be found. Used when syncing a revision locked manifest in |
| 381 | -c mode to avoid having to sync the entire ref space. |
| 382 | |
David Pursehouse | ede7f12 | 2012-11-27 22:25:30 +0900 | [diff] [blame] | 383 | Attribute `clone-depth`: Set the depth to use when fetching this |
| 384 | project. If specified, this value will override any value given |
| 385 | to repo init with the --depth option on the command line. |
| 386 | |
Scott Fan | db83b1b | 2013-02-28 09:34:14 +0800 | [diff] [blame] | 387 | Attribute `force-path`: Set to true to force this project to create the |
| 388 | local mirror repository according to its `path` attribute (if supplied) |
| 389 | rather than the `name` attribute. This attribute only applies to the |
| 390 | local mirrors syncing, it will be ignored when syncing the projects in a |
| 391 | client working directory. |
| 392 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 393 | ### Element extend-project |
Josh Triplett | 884a387 | 2014-06-12 14:57:29 -0700 | [diff] [blame] | 394 | |
| 395 | Modify the attributes of the named project. |
| 396 | |
| 397 | This element is mostly useful in a local manifest file, to modify the |
| 398 | attributes of an existing project without completely replacing the |
| 399 | existing project definition. This makes the local manifest more robust |
| 400 | against changes to the original manifest. |
| 401 | |
| 402 | Attribute `path`: If specified, limit the change to projects checked out |
| 403 | at the specified path, rather than all projects with the given name. |
| 404 | |
Michael Kelly | 37c21c2 | 2020-06-13 02:10:40 -0700 | [diff] [blame] | 405 | Attribute `dest-path`: If specified, a path relative to the top directory |
| 406 | of the repo client where the Git working directory for this project |
| 407 | should be placed. This is used to move a project in the checkout by |
| 408 | overriding the existing `path` setting. |
| 409 | |
Josh Triplett | 884a387 | 2014-06-12 14:57:29 -0700 | [diff] [blame] | 410 | Attribute `groups`: List of additional groups to which this project |
| 411 | belongs. Same syntax as the corresponding element of `project`. |
| 412 | |
Luis Hector Chavez | 7d52585 | 2018-03-15 09:54:08 -0700 | [diff] [blame] | 413 | Attribute `revision`: If specified, overrides the revision of the original |
| 414 | project. Same syntax as the corresponding element of `project`. |
| 415 | |
Kyunam Jo | bd0aae9 | 2020-02-04 11:38:53 +0900 | [diff] [blame] | 416 | Attribute `remote`: If specified, overrides the remote of the original |
| 417 | project. Same syntax as the corresponding element of `project`. |
| 418 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 419 | ### Element annotation |
James W. Mills | 24c1308 | 2012-04-12 15:04:13 -0500 | [diff] [blame] | 420 | |
| 421 | Zero or more annotation elements may be specified as children of a |
Jack Neus | 6ea0cae | 2021-07-20 20:52:33 +0000 | [diff] [blame] | 422 | project or remote element. Each element describes a name-value pair. |
| 423 | For projects, this name-value pair will be exported into each project's |
| 424 | environment during a 'forall' command, prefixed with `REPO__`. In addition, |
| 425 | there is an optional attribute "keep" which accepts the case insensitive values |
| 426 | "true" (default) or "false". This attribute determines whether or not the |
| 427 | annotation will be kept when exported with the manifest subcommand. |
James W. Mills | 24c1308 | 2012-04-12 15:04:13 -0500 | [diff] [blame] | 428 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 429 | ### Element copyfile |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 430 | |
| 431 | Zero or more copyfile elements may be specified as children of a |
| 432 | project element. Each element describes a src-dest pair of files; |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 433 | the "src" file will be copied to the "dest" place during `repo sync` |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 434 | command. |
Mike Frysinger | c5b172a | 2019-07-31 17:34:23 -0400 | [diff] [blame] | 435 | |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 436 | "src" is project relative, "dest" is relative to the top of the tree. |
Mike Frysinger | c5b172a | 2019-07-31 17:34:23 -0400 | [diff] [blame] | 437 | Copying from paths outside of the project or to paths outside of the repo |
| 438 | client is not allowed. |
| 439 | |
| 440 | "src" and "dest" must be files. Directories or symlinks are not allowed. |
| 441 | Intermediate paths must not be symlinks either. |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 442 | |
Mike Frysinger | 50d2763 | 2019-08-01 18:57:10 -0400 | [diff] [blame] | 443 | Parent directories of "dest" will be automatically created if missing. |
| 444 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 445 | ### Element linkfile |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 446 | |
| 447 | It's just like copyfile and runs at the same time as copyfile but |
| 448 | instead of copying it creates a symlink. |
| 449 | |
Mike Frysinger | c5b172a | 2019-07-31 17:34:23 -0400 | [diff] [blame] | 450 | The symlink is created at "dest" (relative to the top of the tree) and |
Mike Frysinger | 04122b7 | 2019-07-31 23:32:58 -0400 | [diff] [blame] | 451 | points to the path specified by "src" which is a path in the project. |
Mike Frysinger | c5b172a | 2019-07-31 17:34:23 -0400 | [diff] [blame] | 452 | |
Mike Frysinger | 50d2763 | 2019-08-01 18:57:10 -0400 | [diff] [blame] | 453 | Parent directories of "dest" will be automatically created if missing. |
| 454 | |
Mike Frysinger | c5b172a | 2019-07-31 17:34:23 -0400 | [diff] [blame] | 455 | The symlink target may be a file or directory, but it may not point outside |
| 456 | of the repo client. |
| 457 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 458 | ### Element remove-project |
Shawn O. Pearce | 03eaf07 | 2008-11-20 11:42:22 -0800 | [diff] [blame] | 459 | |
| 460 | Deletes the named project from the internal manifest table, possibly |
| 461 | allowing a subsequent project element in the same manifest file to |
| 462 | replace the project with a different source. |
| 463 | |
David Pursehouse | b1525bf | 2012-11-14 08:51:38 +0900 | [diff] [blame] | 464 | This element is mostly useful in a local manifest file, where |
Shawn O. Pearce | 03eaf07 | 2008-11-20 11:42:22 -0800 | [diff] [blame] | 465 | the user can remove a project, and possibly replace it with their |
| 466 | own definition. |
| 467 | |
Michael Kelly | 06da998 | 2021-06-30 01:58:28 -0700 | [diff] [blame] | 468 | Attribute `optional`: Set to true to ignore remove-project elements with no |
| 469 | matching `project` element. |
| 470 | |
Mike Frysinger | 51e39d5 | 2020-12-04 05:32:06 -0500 | [diff] [blame] | 471 | ### Element repo-hooks |
| 472 | |
| 473 | NB: See the [practical documentation](./repo-hooks.md) for using repo hooks. |
| 474 | |
| 475 | Only one repo-hooks element may be specified at a time. |
| 476 | Attempting to redefine it will fail to parse. |
| 477 | |
| 478 | Attribute `in-project`: The project where the hooks are defined. The value |
| 479 | must match the `name` attribute (**not** the `path` attribute) of a previously |
| 480 | defined `project` element. |
| 481 | |
| 482 | Attribute `enabled-list`: List of hooks to use, whitespace or comma separated. |
| 483 | |
Raman Tenneti | 1bb4fb2 | 2021-01-07 16:50:45 -0800 | [diff] [blame] | 484 | ### Element superproject |
| 485 | |
| 486 | *** |
Raman Tenneti | 1c3f57e | 2021-05-04 12:32:13 -0700 | [diff] [blame] | 487 | *Note*: This is currently a WIP. |
Raman Tenneti | 1bb4fb2 | 2021-01-07 16:50:45 -0800 | [diff] [blame] | 488 | *** |
| 489 | |
| 490 | NB: See the [git superprojects documentation]( |
| 491 | https://en.wikibooks.org/wiki/Git/Submodules_and_Superprojects) for background |
| 492 | information. |
| 493 | |
| 494 | This element is used to specify the URL of the superproject. It has "name" and |
| 495 | "remote" as atrributes. Only "name" is required while the others have |
| 496 | reasonable defaults. At most one superproject may be specified. |
| 497 | Attempting to redefine it will fail to parse. |
| 498 | |
| 499 | Attribute `name`: A unique name for the superproject. This attribute has the |
| 500 | same meaning as project's name attribute. See the |
| 501 | [element project](#element-project) for more information. |
| 502 | |
| 503 | Attribute `remote`: Name of a previously defined remote element. |
| 504 | If not supplied the remote given by the default element is used. |
| 505 | |
Xin Li | e0b16a2 | 2021-09-26 23:20:32 -0700 | [diff] [blame] | 506 | Attribute `revision`: Name of the Git branch the manifest wants |
| 507 | to track for this superproject. If not supplied the revision given |
| 508 | by the remote element is used if applicable, else the default |
| 509 | element is used. |
| 510 | |
Raman Tenneti | 1c3f57e | 2021-05-04 12:32:13 -0700 | [diff] [blame] | 511 | ### Element contactinfo |
| 512 | |
| 513 | *** |
| 514 | *Note*: This is currently a WIP. |
| 515 | *** |
| 516 | |
| 517 | This element is used to let manifest authors self-register contact info. |
| 518 | It has "bugurl" as a required atrribute. This element can be repeated, |
| 519 | and any later entries will clobber earlier ones. This would allow manifest |
| 520 | authors who extend manifests to specify their own contact info. |
| 521 | |
| 522 | Attribute `bugurl`: The URL to file a bug against the manifest owner. |
| 523 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 524 | ### Element include |
Brian Harring | 2644874 | 2011-04-28 05:04:41 -0700 | [diff] [blame] | 525 | |
| 526 | This element provides the capability of including another manifest |
| 527 | file into the originating manifest. Normal rules apply for the |
David Pursehouse | 9f3406e | 2012-11-14 08:52:25 +0900 | [diff] [blame] | 528 | target manifest to include - it must be a usable manifest on its own. |
Brian Harring | 2644874 | 2011-04-28 05:04:41 -0700 | [diff] [blame] | 529 | |
David Pursehouse | 9f3406e | 2012-11-14 08:52:25 +0900 | [diff] [blame] | 530 | Attribute `name`: the manifest to include, specified relative to |
| 531 | the manifest repository's root. |
Brian Harring | 2644874 | 2011-04-28 05:04:41 -0700 | [diff] [blame] | 532 | |
Mike Frysinger | 68d5d4d | 2021-03-09 11:56:24 -0500 | [diff] [blame] | 533 | "name" may not be an absolute path or use "." or ".." path components. |
| 534 | These restrictions are not enforced for [Local Manifests]. |
| 535 | |
Fredrik de Groot | 352c93b | 2020-10-06 12:55:14 +0200 | [diff] [blame] | 536 | Attribute `groups`: List of additional groups to which all projects |
| 537 | in the included manifest belong. This appends and recurses, meaning |
LaMont Jones | cc879a9 | 2021-11-18 22:40:18 +0000 | [diff] [blame^] | 538 | all projects in included manifests carry all parent include groups. |
Fredrik de Groot | 352c93b | 2020-10-06 12:55:14 +0200 | [diff] [blame] | 539 | Same syntax as the corresponding element of `project`. |
Shawn O. Pearce | 03eaf07 | 2008-11-20 11:42:22 -0800 | [diff] [blame] | 540 | |
Mike Frysinger | 68d5d4d | 2021-03-09 11:56:24 -0500 | [diff] [blame] | 541 | ## Local Manifests {#local-manifests} |
Shawn O. Pearce | 70cd4ab | 2008-11-06 08:48:44 -0800 | [diff] [blame] | 542 | |
David Pursehouse | 2d5a0df | 2012-11-13 02:50:36 +0900 | [diff] [blame] | 543 | Additional remotes and projects may be added through local manifest |
| 544 | files stored in `$TOP_DIR/.repo/local_manifests/*.xml`. |
Shawn O. Pearce | 70cd4ab | 2008-11-06 08:48:44 -0800 | [diff] [blame] | 545 | |
| 546 | For example: |
| 547 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 548 | $ ls .repo/local_manifests |
| 549 | local_manifest.xml |
| 550 | another_local_manifest.xml |
David Pursehouse | 2d5a0df | 2012-11-13 02:50:36 +0900 | [diff] [blame] | 551 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 552 | $ cat .repo/local_manifests/local_manifest.xml |
| 553 | |
| 554 | |
| 555 | |
| 556 | name="tools/manifest" /> |
| 557 | |
| 558 | name="platform/manifest" /> |
| 559 | |
Shawn O. Pearce | 70cd4ab | 2008-11-06 08:48:44 -0800 | [diff] [blame] | 560 | |
David Pursehouse | 2d5a0df | 2012-11-13 02:50:36 +0900 | [diff] [blame] | 561 | Users may add projects to the local manifest(s) prior to a `repo sync` |
Shawn O. Pearce | 70cd4ab | 2008-11-06 08:48:44 -0800 | [diff] [blame] | 562 | invocation, instructing repo to automatically download and manage |
| 563 | these extra projects. |
David Pursehouse | 2d5a0df | 2012-11-13 02:50:36 +0900 | [diff] [blame] | 564 | |
David Pursehouse | 52f1e5d | 2012-11-14 04:53:24 +0900 | [diff] [blame] | 565 | Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will |
| 566 | be loaded in alphabetical order. |
| 567 | |
Raman Tenneti | 78f4dd3 | 2021-06-07 13:27:37 -0700 | [diff] [blame] | 568 | Projects from local manifest files are added into |
| 569 | local:: group. |
| 570 | |
Mike Frysinger | 4e1fc10 | 2020-09-06 14:42:47 -0400 | [diff] [blame] | 571 | The legacy `$TOP_DIR/.repo/local_manifest.xml` path is no longer supported. |
Mike Frysinger | 68d5d4d | 2021-03-09 11:56:24 -0500 | [diff] [blame] | 572 | |
| 573 | |
| 574 | [copyfile]: #Element-copyfile |
| 575 | [linkfile]: #Element-linkfile |
| 576 | [Local Manifests]: #local-manifests |