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 | <!DOCTYPE manifest [ |
| 24 | <!ELEMENT manifest (notice?, |
| 25 | remote*, |
| 26 | default?, |
| 27 | manifest-server?, |
| 28 | remove-project*, |
| 29 | project*, |
| 30 | extend-project*, |
| 31 | repo-hooks?, |
| 32 | include*)> |
Chirayu Desai | d5a5b19 | 2013-11-21 19:15:30 +0530 | [diff] [blame] | 33 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 34 | <!ELEMENT notice (#PCDATA)> |
Chirayu Desai | d5a5b19 | 2013-11-21 19:15:30 +0530 | [diff] [blame] | 35 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 36 | <!ELEMENT remote EMPTY> |
| 37 | <!ATTLIST remote name ID #REQUIRED> |
| 38 | <!ATTLIST remote alias CDATA #IMPLIED> |
| 39 | <!ATTLIST remote fetch CDATA #REQUIRED> |
| 40 | <!ATTLIST remote pushurl CDATA #IMPLIED> |
| 41 | <!ATTLIST remote review CDATA #IMPLIED> |
| 42 | <!ATTLIST remote revision CDATA #IMPLIED> |
Chirayu Desai | d5a5b19 | 2013-11-21 19:15:30 +0530 | [diff] [blame] | 43 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 44 | <!ELEMENT default EMPTY> |
| 45 | <!ATTLIST default remote IDREF #IMPLIED> |
| 46 | <!ATTLIST default revision CDATA #IMPLIED> |
| 47 | <!ATTLIST default dest-branch CDATA #IMPLIED> |
| 48 | <!ATTLIST default upstream CDATA #IMPLIED> |
| 49 | <!ATTLIST default sync-j CDATA #IMPLIED> |
| 50 | <!ATTLIST default sync-c CDATA #IMPLIED> |
| 51 | <!ATTLIST default sync-s CDATA #IMPLIED> |
| 52 | <!ATTLIST default sync-tags CDATA #IMPLIED> |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 53 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 54 | <!ELEMENT manifest-server EMPTY> |
| 55 | <!ATTLIST manifest-server url CDATA #REQUIRED> |
Chirayu Desai | d5a5b19 | 2013-11-21 19:15:30 +0530 | [diff] [blame] | 56 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 57 | <!ELEMENT project (annotation*, |
| 58 | project*, |
| 59 | copyfile*, |
| 60 | linkfile*)> |
| 61 | <!ATTLIST project name CDATA #REQUIRED> |
| 62 | <!ATTLIST project path CDATA #IMPLIED> |
| 63 | <!ATTLIST project remote IDREF #IMPLIED> |
| 64 | <!ATTLIST project revision CDATA #IMPLIED> |
| 65 | <!ATTLIST project dest-branch CDATA #IMPLIED> |
| 66 | <!ATTLIST project groups CDATA #IMPLIED> |
| 67 | <!ATTLIST project sync-c CDATA #IMPLIED> |
| 68 | <!ATTLIST project sync-s CDATA #IMPLIED> |
Kyunam Jo | 01019d9 | 2019-03-18 13:30:58 +0900 | [diff] [blame] | 69 | <!ATTLIST project sync-tags CDATA #IMPLIED> |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 70 | <!ATTLIST project upstream CDATA #IMPLIED> |
| 71 | <!ATTLIST project clone-depth CDATA #IMPLIED> |
| 72 | <!ATTLIST project force-path CDATA #IMPLIED> |
James W. Mills | 24c1308 | 2012-04-12 15:04:13 -0500 | [diff] [blame] | 73 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 74 | <!ELEMENT annotation EMPTY> |
| 75 | <!ATTLIST annotation name CDATA #REQUIRED> |
| 76 | <!ATTLIST annotation value CDATA #REQUIRED> |
| 77 | <!ATTLIST annotation keep CDATA "true"> |
Chirayu Desai | d5a5b19 | 2013-11-21 19:15:30 +0530 | [diff] [blame] | 78 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 79 | <!ELEMENT copyfile EMPTY> |
| 80 | <!ATTLIST copyfile src CDATA #REQUIRED> |
| 81 | <!ATTLIST copyfile dest CDATA #REQUIRED> |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 82 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 83 | <!ELEMENT linkfile EMPTY> |
| 84 | <!ATTLIST linkfile src CDATA #REQUIRED> |
| 85 | <!ATTLIST linkfile dest CDATA #REQUIRED> |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 86 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 87 | <!ELEMENT extend-project EMPTY> |
| 88 | <!ATTLIST extend-project name CDATA #REQUIRED> |
| 89 | <!ATTLIST extend-project path CDATA #IMPLIED> |
| 90 | <!ATTLIST extend-project groups CDATA #IMPLIED> |
| 91 | <!ATTLIST extend-project revision CDATA #IMPLIED> |
Kyunam Jo | bd0aae9 | 2020-02-04 11:38:53 +0900 | [diff] [blame] | 92 | <!ATTLIST extend-project remote CDATA #IMPLIED> |
Josh Triplett | 884a387 | 2014-06-12 14:57:29 -0700 | [diff] [blame] | 93 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 94 | <!ELEMENT remove-project EMPTY> |
| 95 | <!ATTLIST remove-project name CDATA #REQUIRED> |
Doug Anderson | 37282b4 | 2011-03-04 11:54:18 -0800 | [diff] [blame] | 96 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 97 | <!ELEMENT repo-hooks EMPTY> |
| 98 | <!ATTLIST repo-hooks in-project CDATA #REQUIRED> |
| 99 | <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED> |
Brian Harring | 2644874 | 2011-04-28 05:04:41 -0700 | [diff] [blame] | 100 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 101 | <!ELEMENT include EMPTY> |
Fredrik de Groot | 352c93b | 2020-10-06 12:55:14 +0200 | [diff] [blame^] | 102 | <!ATTLIST include name CDATA #REQUIRED> |
| 103 | <!ATTLIST include groups CDATA #IMPLIED> |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 104 | ]> |
| 105 | ``` |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 106 | |
| 107 | A description of the elements and their attributes follows. |
| 108 | |
| 109 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 110 | ### Element manifest |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 111 | |
| 112 | The root element of the file. |
| 113 | |
| 114 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 115 | ### Element remote |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 116 | |
| 117 | One or more remote elements may be specified. Each remote element |
| 118 | specifies a Git URL shared by one or more projects and (optionally) |
| 119 | the Gerrit review server those projects upload changes through. |
| 120 | |
| 121 | Attribute `name`: A short name unique to this manifest file. The |
| 122 | name specified here is used as the remote name in each project's |
| 123 | .git/config, and is therefore automatically available to commands |
| 124 | like `git fetch`, `git remote`, `git pull` and `git push`. |
| 125 | |
Yestin Sun | b292b98 | 2012-07-02 07:32:50 -0700 | [diff] [blame] | 126 | Attribute `alias`: The alias, if specified, is used to override |
| 127 | `name` to be set as the remote name in each project's .git/config. |
| 128 | Its value can be duplicated while attribute `name` has to be unique |
| 129 | in the manifest file. This helps each project to be able to have |
| 130 | same remote name which actually points to different remote url. |
| 131 | |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 132 | Attribute `fetch`: The Git URL prefix for all projects which use |
| 133 | this remote. Each project's name is appended to this prefix to |
| 134 | form the actual URL used to clone the project. |
| 135 | |
Steve Rae | d648045 | 2016-08-10 15:00:00 -0700 | [diff] [blame] | 136 | Attribute `pushurl`: The Git "push" URL prefix for all projects |
| 137 | which use this remote. Each project's name is appended to this |
| 138 | prefix to form the actual URL used to "git push" the project. |
| 139 | This attribute is optional; if not specified then "git push" |
| 140 | will use the same URL as the `fetch` attribute. |
| 141 | |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 142 | Attribute `review`: Hostname of the Gerrit server where reviews |
| 143 | are uploaded to by `repo upload`. This attribute is optional; |
| 144 | if not specified then `repo upload` will not function. |
| 145 | |
Mike Frysinger | 6e89c96 | 2020-11-15 18:42:26 -0500 | [diff] [blame] | 146 | Attribute `revision`: Name of a Git branch (e.g. `main` or |
| 147 | `refs/heads/main`). Remotes with their own revision will override |
Anthony King | 36ea2fb | 2014-05-06 11:54:01 +0100 | [diff] [blame] | 148 | the default revision. |
| 149 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 150 | ### Element default |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 151 | |
| 152 | At most one default element may be specified. Its remote and |
| 153 | revision attributes are used when a project element does not |
| 154 | specify its own remote or revision attribute. |
| 155 | |
| 156 | Attribute `remote`: Name of a previously defined remote element. |
| 157 | Project elements lacking a remote attribute of their own will use |
| 158 | this remote. |
| 159 | |
Mike Frysinger | 6e89c96 | 2020-11-15 18:42:26 -0500 | [diff] [blame] | 160 | Attribute `revision`: Name of a Git branch (e.g. `main` or |
| 161 | `refs/heads/main`). Project elements lacking their own |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 162 | revision attribute will use this revision. |
| 163 | |
Mike Frysinger | 6e89c96 | 2020-11-15 18:42:26 -0500 | [diff] [blame] | 164 | Attribute `dest-branch`: Name of a Git branch (e.g. `main`). |
Bryan Jacobs | f609f91 | 2013-05-06 13:36:24 -0400 | [diff] [blame] | 165 | Project elements not setting their own `dest-branch` will inherit |
| 166 | this value. If this value is not set, projects will use `revision` |
| 167 | by default instead. |
| 168 | |
Nasser Grainawi | da40341 | 2018-05-04 12:53:29 -0600 | [diff] [blame] | 169 | Attribute `upstream`: Name of the Git ref in which a sha1 |
| 170 | can be found. Used when syncing a revision locked manifest in |
| 171 | -c mode to avoid having to sync the entire ref space. Project elements |
| 172 | not setting their own `upstream` will inherit this value. |
| 173 | |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 174 | Attribute `sync-j`: Number of parallel jobs to use when synching. |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 175 | |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 176 | Attribute `sync-c`: Set to true to only sync the given Git |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 177 | branch (specified in the `revision` attribute) rather than the |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 178 | whole ref space. Project elements lacking a sync-c element of |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 179 | their own will use this value. |
| 180 | |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 181 | Attribute `sync-s`: Set to true to also sync sub-projects. |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 182 | |
YOUNG HO CHA | a32c92c | 2018-02-14 16:57:31 +0900 | [diff] [blame] | 183 | Attribute `sync-tags`: Set to false to only sync the given Git |
| 184 | branch (specified in the `revision` attribute) rather than |
| 185 | the other ref tags. |
| 186 | |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 187 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 188 | ### Element manifest-server |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 189 | |
| 190 | At most one manifest-server may be specified. The url attribute |
| 191 | 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] | 192 | XML RPC service. |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 193 | |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 194 | The manifest server should implement the following RPC methods: |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 195 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 196 | GetApprovedManifest(branch, target) |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 197 | |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 198 | 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] | 199 | for the current branch and target. This is used by repo sync when the |
| 200 | --smart-sync option is given. |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 201 | |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 202 | The target to use is defined by environment variables TARGET_PRODUCT |
| 203 | and TARGET_BUILD_VARIANT. These variables are used to create a string |
| 204 | of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug. |
| 205 | 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] | 206 | GetApprovedManifest without the target parameter and the manifest server |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 207 | should choose a reasonable default target. |
| 208 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 209 | GetManifest(tag) |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 210 | |
| 211 | 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] | 212 | the specified tag. This is used by repo sync when the --smart-tag option |
| 213 | is given. |
David Pursehouse | 9a27d01 | 2012-08-21 14:23:49 +0900 | [diff] [blame] | 214 | |
Nico Sallembien | a1bfd2c | 2010-04-06 10:40:01 -0700 | [diff] [blame] | 215 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 216 | ### Element project |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 217 | |
| 218 | One or more project elements may be specified. Each element |
| 219 | describes a single Git repository to be cloned into the repo |
Che-Liang Chiou | b2bd91c | 2012-01-11 11:28:42 +0800 | [diff] [blame] | 220 | client workspace. You may specify Git-submodules by creating a |
| 221 | nested project. Git-submodules will be automatically |
| 222 | recognized and inherit their parent's attributes, but those |
| 223 | may be overridden by an explicitly specified project element. |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 224 | |
| 225 | Attribute `name`: A unique name for this project. The project's |
| 226 | name is appended onto its remote's fetch URL to generate the actual |
| 227 | URL to configure the Git remote with. The URL gets formed as: |
| 228 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 229 | ${remote_fetch}/${project_name}.git |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 230 | |
| 231 | where ${remote_fetch} is the remote's fetch attribute and |
| 232 | ${project_name} is the project's name attribute. The suffix ".git" |
David Pursehouse | daa851f | 2012-08-21 13:52:18 +0900 | [diff] [blame] | 233 | 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] | 234 | bare Git repositories. If the project has a parent element, its |
| 235 | name will be prefixed by the parent's. |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 236 | |
| 237 | The project name must match the name Gerrit knows, if Gerrit is |
| 238 | being used for code reviews. |
| 239 | |
| 240 | Attribute `path`: An optional path relative to the top directory |
| 241 | of the repo client where the Git working directory for this project |
| 242 | should be placed. If not supplied the project name is used. |
Che-Liang Chiou | b2bd91c | 2012-01-11 11:28:42 +0800 | [diff] [blame] | 243 | If the project has a parent element, its path will be prefixed |
| 244 | by the parent's. |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 245 | |
| 246 | Attribute `remote`: Name of a previously defined remote element. |
| 247 | If not supplied the remote given by the default element is used. |
| 248 | |
| 249 | Attribute `revision`: Name of the Git branch the manifest wants |
| 250 | to track for this project. Names can be relative to refs/heads |
Mike Frysinger | 6e89c96 | 2020-11-15 18:42:26 -0500 | [diff] [blame] | 251 | (e.g. just "main") or absolute (e.g. "refs/heads/main"). |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 252 | Tags and/or explicit SHA-1s should work in theory, but have not |
| 253 | been extensively tested. If not supplied the revision given by |
Anthony King | 36ea2fb | 2014-05-06 11:54:01 +0100 | [diff] [blame] | 254 | the remote element is used if applicable, else the default |
| 255 | element is used. |
Shawn O. Pearce | 3e54819 | 2008-11-04 11:19:36 -0800 | [diff] [blame] | 256 | |
Mike Frysinger | 6e89c96 | 2020-11-15 18:42:26 -0500 | [diff] [blame] | 257 | Attribute `dest-branch`: Name of a Git branch (e.g. `main`). |
Bryan Jacobs | f609f91 | 2013-05-06 13:36:24 -0400 | [diff] [blame] | 258 | When using `repo upload`, changes will be submitted for code |
| 259 | review on this branch. If unspecified both here and in the |
| 260 | default element, `revision` is used instead. |
| 261 | |
Colin Cross | 5acde75 | 2012-03-28 20:15:45 -0700 | [diff] [blame] | 262 | Attribute `groups`: List of groups to which this project belongs, |
Conley Owens | 971de8e | 2012-04-16 10:36:08 -0700 | [diff] [blame] | 263 | whitespace or comma separated. All projects belong to the group |
Conley Owens | bb1b5f5 | 2012-08-13 13:11:18 -0700 | [diff] [blame] | 264 | "all", and each project automatically belongs to a group of |
| 265 | its name:`name` and path:`path`. E.g. for |
Brian Harring | 7da1314 | 2012-06-15 02:24:20 -0700 | [diff] [blame] | 266 | <project name="monkeys" path="barrel-of"/>, that project |
| 267 | definition is implicitly in the following manifest groups: |
Conley Owens | bb1b5f5 | 2012-08-13 13:11:18 -0700 | [diff] [blame] | 268 | default, name:monkeys, and path:barrel-of. If you place a project in the |
| 269 | group "notdefault", it will not be automatically downloaded by repo. |
Che-Liang Chiou | b2bd91c | 2012-01-11 11:28:42 +0800 | [diff] [blame] | 270 | If the project has a parent element, the `name` and `path` here |
| 271 | are the prefixed ones. |
Colin Cross | 5acde75 | 2012-03-28 20:15:45 -0700 | [diff] [blame] | 272 | |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 273 | Attribute `sync-c`: Set to true to only sync the given Git |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 274 | branch (specified in the `revision` attribute) rather than the |
| 275 | whole ref space. |
| 276 | |
Mani Chandel | 7a91d51 | 2014-07-24 16:27:08 +0530 | [diff] [blame] | 277 | Attribute `sync-s`: Set to true to also sync sub-projects. |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 278 | |
Nasser Grainawi | 909d58b | 2014-09-19 12:13:04 -0600 | [diff] [blame] | 279 | Attribute `upstream`: Name of the Git ref in which a sha1 |
David Pursehouse | 4e46520 | 2012-11-27 22:20:10 +0900 | [diff] [blame] | 280 | can be found. Used when syncing a revision locked manifest in |
| 281 | -c mode to avoid having to sync the entire ref space. |
| 282 | |
David Pursehouse | ede7f12 | 2012-11-27 22:25:30 +0900 | [diff] [blame] | 283 | Attribute `clone-depth`: Set the depth to use when fetching this |
| 284 | project. If specified, this value will override any value given |
| 285 | to repo init with the --depth option on the command line. |
| 286 | |
Scott Fan | db83b1b | 2013-02-28 09:34:14 +0800 | [diff] [blame] | 287 | Attribute `force-path`: Set to true to force this project to create the |
| 288 | local mirror repository according to its `path` attribute (if supplied) |
| 289 | rather than the `name` attribute. This attribute only applies to the |
| 290 | local mirrors syncing, it will be ignored when syncing the projects in a |
| 291 | client working directory. |
| 292 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 293 | ### Element extend-project |
Josh Triplett | 884a387 | 2014-06-12 14:57:29 -0700 | [diff] [blame] | 294 | |
| 295 | Modify the attributes of the named project. |
| 296 | |
| 297 | This element is mostly useful in a local manifest file, to modify the |
| 298 | attributes of an existing project without completely replacing the |
| 299 | existing project definition. This makes the local manifest more robust |
| 300 | against changes to the original manifest. |
| 301 | |
| 302 | Attribute `path`: If specified, limit the change to projects checked out |
| 303 | at the specified path, rather than all projects with the given name. |
| 304 | |
| 305 | Attribute `groups`: List of additional groups to which this project |
| 306 | belongs. Same syntax as the corresponding element of `project`. |
| 307 | |
Luis Hector Chavez | 7d52585 | 2018-03-15 09:54:08 -0700 | [diff] [blame] | 308 | Attribute `revision`: If specified, overrides the revision of the original |
| 309 | project. Same syntax as the corresponding element of `project`. |
| 310 | |
Kyunam Jo | bd0aae9 | 2020-02-04 11:38:53 +0900 | [diff] [blame] | 311 | Attribute `remote`: If specified, overrides the remote of the original |
| 312 | project. Same syntax as the corresponding element of `project`. |
| 313 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 314 | ### Element annotation |
James W. Mills | 24c1308 | 2012-04-12 15:04:13 -0500 | [diff] [blame] | 315 | |
| 316 | Zero or more annotation elements may be specified as children of a |
| 317 | project element. Each element describes a name-value pair that will be |
| 318 | exported into each project's environment during a 'forall' command, |
| 319 | prefixed with REPO__. In addition, there is an optional attribute |
| 320 | "keep" which accepts the case insensitive values "true" (default) or |
| 321 | "false". This attribute determines whether or not the annotation will |
| 322 | be kept when exported with the manifest subcommand. |
| 323 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 324 | ### Element copyfile |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 325 | |
| 326 | Zero or more copyfile elements may be specified as children of a |
| 327 | project element. Each element describes a src-dest pair of files; |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 328 | 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] | 329 | command. |
Mike Frysinger | c5b172a | 2019-07-31 17:34:23 -0400 | [diff] [blame] | 330 | |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 331 | "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] | 332 | Copying from paths outside of the project or to paths outside of the repo |
| 333 | client is not allowed. |
| 334 | |
| 335 | "src" and "dest" must be files. Directories or symlinks are not allowed. |
| 336 | Intermediate paths must not be symlinks either. |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 337 | |
Mike Frysinger | 50d2763 | 2019-08-01 18:57:10 -0400 | [diff] [blame] | 338 | Parent directories of "dest" will be automatically created if missing. |
| 339 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 340 | ### Element linkfile |
Ruslan Bilovol | 54527e7 | 2015-09-08 13:11:23 +0300 | [diff] [blame] | 341 | |
| 342 | It's just like copyfile and runs at the same time as copyfile but |
| 343 | instead of copying it creates a symlink. |
| 344 | |
Mike Frysinger | c5b172a | 2019-07-31 17:34:23 -0400 | [diff] [blame] | 345 | 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] | 346 | 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] | 347 | |
Mike Frysinger | 50d2763 | 2019-08-01 18:57:10 -0400 | [diff] [blame] | 348 | Parent directories of "dest" will be automatically created if missing. |
| 349 | |
Mike Frysinger | c5b172a | 2019-07-31 17:34:23 -0400 | [diff] [blame] | 350 | The symlink target may be a file or directory, but it may not point outside |
| 351 | of the repo client. |
| 352 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 353 | ### Element remove-project |
Shawn O. Pearce | 03eaf07 | 2008-11-20 11:42:22 -0800 | [diff] [blame] | 354 | |
| 355 | Deletes the named project from the internal manifest table, possibly |
| 356 | allowing a subsequent project element in the same manifest file to |
| 357 | replace the project with a different source. |
| 358 | |
David Pursehouse | b1525bf | 2012-11-14 08:51:38 +0900 | [diff] [blame] | 359 | This element is mostly useful in a local manifest file, where |
Shawn O. Pearce | 03eaf07 | 2008-11-20 11:42:22 -0800 | [diff] [blame] | 360 | the user can remove a project, and possibly replace it with their |
| 361 | own definition. |
| 362 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 363 | ### Element include |
Brian Harring | 2644874 | 2011-04-28 05:04:41 -0700 | [diff] [blame] | 364 | |
| 365 | This element provides the capability of including another manifest |
| 366 | file into the originating manifest. Normal rules apply for the |
David Pursehouse | 9f3406e | 2012-11-14 08:52:25 +0900 | [diff] [blame] | 367 | 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] | 368 | |
David Pursehouse | 9f3406e | 2012-11-14 08:52:25 +0900 | [diff] [blame] | 369 | Attribute `name`: the manifest to include, specified relative to |
| 370 | the manifest repository's root. |
Brian Harring | 2644874 | 2011-04-28 05:04:41 -0700 | [diff] [blame] | 371 | |
Fredrik de Groot | 352c93b | 2020-10-06 12:55:14 +0200 | [diff] [blame^] | 372 | Attribute `groups`: List of additional groups to which all projects |
| 373 | in the included manifest belong. This appends and recurses, meaning |
| 374 | all projects in sub-manifests carry all parent include groups. |
| 375 | Same syntax as the corresponding element of `project`. |
Shawn O. Pearce | 03eaf07 | 2008-11-20 11:42:22 -0800 | [diff] [blame] | 376 | |
Mike Frysinger | b8f7bb0 | 2018-10-10 01:05:11 -0400 | [diff] [blame] | 377 | ## Local Manifests |
Shawn O. Pearce | 70cd4ab | 2008-11-06 08:48:44 -0800 | [diff] [blame] | 378 | |
David Pursehouse | 2d5a0df | 2012-11-13 02:50:36 +0900 | [diff] [blame] | 379 | Additional remotes and projects may be added through local manifest |
| 380 | files stored in `$TOP_DIR/.repo/local_manifests/*.xml`. |
Shawn O. Pearce | 70cd4ab | 2008-11-06 08:48:44 -0800 | [diff] [blame] | 381 | |
| 382 | For example: |
| 383 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 384 | $ ls .repo/local_manifests |
| 385 | local_manifest.xml |
| 386 | another_local_manifest.xml |
David Pursehouse | 2d5a0df | 2012-11-13 02:50:36 +0900 | [diff] [blame] | 387 | |
Mike Frysinger | 3891b75 | 2018-10-05 19:26:15 -0400 | [diff] [blame] | 388 | $ cat .repo/local_manifests/local_manifest.xml |
| 389 | <?xml version="1.0" encoding="UTF-8"?> |
| 390 | <manifest> |
| 391 | <project path="manifest" |
| 392 | name="tools/manifest" /> |
| 393 | <project path="platform-manifest" |
| 394 | name="platform/manifest" /> |
| 395 | </manifest> |
Shawn O. Pearce | 70cd4ab | 2008-11-06 08:48:44 -0800 | [diff] [blame] | 396 | |
David Pursehouse | 2d5a0df | 2012-11-13 02:50:36 +0900 | [diff] [blame] | 397 | 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] | 398 | invocation, instructing repo to automatically download and manage |
| 399 | these extra projects. |
David Pursehouse | 2d5a0df | 2012-11-13 02:50:36 +0900 | [diff] [blame] | 400 | |
David Pursehouse | 52f1e5d | 2012-11-14 04:53:24 +0900 | [diff] [blame] | 401 | Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will |
| 402 | be loaded in alphabetical order. |
| 403 | |
Mike Frysinger | 4e1fc10 | 2020-09-06 14:42:47 -0400 | [diff] [blame] | 404 | The legacy `$TOP_DIR/.repo/local_manifest.xml` path is no longer supported. |