Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Gerrit Code Review - Project Configuration File Format |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 2 | |
| 3 | This page explains the storage format of Gerrit's project configuration |
| 4 | and access control models. |
| 5 | |
| 6 | The web UI access control panel is a front end for human-readable |
| 7 | configuration files under the +refs/meta/config+ namespace in the |
| 8 | affected project. Direct manipulation of these files is mainly |
| 9 | relevant in an automation scenario of the access controls. |
| 10 | |
| 11 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 12 | == The +refs/meta/config+ namespace |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 13 | |
| 14 | The namespace contains three different files that play different |
| 15 | roles in the permission model. With read permission to that reference, |
| 16 | it is possible to fetch the +refs/meta/config+ reference to a local |
| 17 | repository. A nice side effect is that you can also upload changes |
| 18 | to project permissions and review them just like with regular code |
| 19 | changes. The preview changes option is also provided on the UI. Please note |
| 20 | that you will have to configure push rights for the +refs/meta/config+ name |
| 21 | space if you'd like to use the possibility to automate permission updates. |
| 22 | |
Björn Pedersen | d169b6d | 2016-08-31 17:56:45 +0200 | [diff] [blame] | 23 | == Property inheritance |
| 24 | |
| 25 | If a property is set to INHERIT, then the value from the parent project is |
| 26 | used. If the property is not set in any parent project, the default value is |
| 27 | FALSE. |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 28 | |
| 29 | [[file-project_config]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 30 | == The file +project.config+ |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 31 | |
| 32 | The +project.config+ file contains the link between groups and their |
| 33 | permitted actions on reference patterns in this project and any projects |
| 34 | that inherit its permissions. |
| 35 | |
| 36 | The format in this file corresponds to the Git config file format, so |
| 37 | if you want to automate your permissions it is a good idea to use the |
| 38 | +git config+ command when writing to the file. This way you know you |
| 39 | don't accidentally break the format of the file. |
| 40 | |
| 41 | Here follows a +git config+ command example: |
| 42 | |
| 43 | ---- |
| 44 | $ git config -f project.config project.description "Rights inherited by all other projects" |
| 45 | ---- |
| 46 | |
| 47 | Below you will find an example of the +project.config+ file format: |
| 48 | |
| 49 | ---- |
| 50 | [project] |
| 51 | description = Rights inherited by all other projects |
| 52 | [access "refs/*"] |
| 53 | read = group Administrators |
David Myllykangas | b3ccec6 | 2015-01-21 15:41:13 +0100 | [diff] [blame] | 54 | [access "refs/heads/*"] |
| 55 | label-Your-Label-Here = -1..+1 group Administrators |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 56 | [capability] |
| 57 | administrateServer = group Administrators |
| 58 | [receive] |
| 59 | requireContributorAgreement = false |
David Myllykangas | b3ccec6 | 2015-01-21 15:41:13 +0100 | [diff] [blame] | 60 | [label "Your-Label-Here"] |
| 61 | function = MaxWithBlock |
| 62 | value = -1 Your -1 Description |
| 63 | value = 0 Your No score Description |
| 64 | value = +1 Your +1 Description |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 65 | ---- |
| 66 | |
| 67 | As you can see, there are several sections. |
| 68 | |
| 69 | The link:#project-section[+project+ section] appears once per project. |
| 70 | |
| 71 | The link:#access-section[+access+ section] appears once per reference pattern, |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 72 | such as `+refs/*+` or `+refs/heads/*+`. Only one access section per pattern is |
David Pursehouse | acb5c1d | 2016-08-29 10:29:57 +0900 | [diff] [blame] | 73 | allowed. |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 74 | |
| 75 | The link:#receive-section[+receive+ section] appears once per project. |
| 76 | |
| 77 | The link:#submit-section[+submit+ section] appears once per project. |
| 78 | |
| 79 | The link:#capability-section[+capability+] section only appears once, and only |
| 80 | in the +All-Projects+ repository. It controls core features that are configured |
David Pursehouse | acb5c1d | 2016-08-29 10:29:57 +0900 | [diff] [blame] | 81 | on a global level. |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 82 | |
David Myllykangas | b3ccec6 | 2015-01-21 15:41:13 +0100 | [diff] [blame] | 83 | The link:#label-section[+label+] section can appear multiple times. You can |
| 84 | also redefine the text and behavior of the built in label types `Code-Review` |
| 85 | and `Verified`. |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 86 | |
Edwin Kempin | 424f96c6 | 2016-10-13 09:00:55 +0200 | [diff] [blame] | 87 | Optionally a +commentlink+ section can be added to define project-specific |
| 88 | comment links. The +commentlink+ section has the same format as the |
| 89 | link:config-gerrit.html#commentlink[+commentlink+ section in gerrit.config] |
| 90 | which is used to define global comment links. |
| 91 | |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 92 | [[project-section]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 93 | === Project section |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 94 | |
| 95 | The project section includes configuration of project settings. |
| 96 | |
| 97 | These are the keys: |
| 98 | |
Changcheng Xiao | 5ecb642 | 2019-01-15 17:17:04 +0100 | [diff] [blame] | 99 | [[description]]description:: |
| 100 | + |
| 101 | A description for the project. |
| 102 | |
Edwin Kempin | 1fd0854 | 2019-06-26 10:20:29 +0200 | [diff] [blame] | 103 | [[state]]state:: |
Changcheng Xiao | 5ecb642 | 2019-01-15 17:17:04 +0100 | [diff] [blame] | 104 | + |
| 105 | This setting defines the state of the project. A project can have the |
| 106 | following states: |
| 107 | |
| 108 | - `Active`: |
| 109 | + |
| 110 | The project is active and users can see and modify the project according |
| 111 | to their access rights on the project. |
| 112 | |
| 113 | - `Read Only`: |
| 114 | + |
| 115 | The project is read only and all modifying operations on it are |
| 116 | disabled. E.g. this means that pushing to this project fails for all |
| 117 | users even if they have push permissions assigned on it. |
| 118 | + |
| 119 | Setting a project to this state is an easy way to temporary close a |
| 120 | project, as you can keep all write access rights in place and they will |
| 121 | become active again as soon as the project state is set back to |
| 122 | `Active`. |
| 123 | + |
| 124 | This state also makes sense if a project was moved to another location. |
| 125 | In this case all new development should happen in the new project and |
| 126 | you want to prevent that somebody accidentally works on the old |
| 127 | project, while keeping the old project around for old references. |
| 128 | |
| 129 | - `Hidden`: |
| 130 | + |
| 131 | The project is hidden and only visible to project owners. Other users |
| 132 | are not able to see the project even if they have read permissions |
| 133 | granted on the project. |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 134 | |
| 135 | |
| 136 | [[receive-section]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 137 | === Receive section |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 138 | |
| 139 | The receive section includes configuration of project-specific |
| 140 | receive settings: |
| 141 | |
| 142 | [[receive.requireContributorAgreement]]receive.requireContributorAgreement:: |
| 143 | + |
| 144 | Controls whether or not a user must complete a contributor agreement before |
| 145 | they can upload changes. Default is `INHERIT`. If `All-Project` enables this |
| 146 | option then the dependent project must set it to false if users are not |
| 147 | required to sign a contributor agreement prior to submitting changes for that |
| 148 | specific project. To use that feature the global option in `gerrit.config` |
| 149 | must be enabled: |
| 150 | link:config-gerrit.html#auth.contributorAgreements[auth.contributorAgreements]. |
| 151 | |
| 152 | [[receive.requireSignedOffBy]]receive.requireSignedOffBy:: |
| 153 | + |
| 154 | Sign-off can be a requirement for some projects (for example Linux kernel uses |
| 155 | it). Sign-off is a line at the end of the commit message which certifies who |
| 156 | is the author of the commit. Its main purpose is to improve tracking of who |
| 157 | did what, especially with patches. Default is `INHERIT`, which means that this |
| 158 | property is inherited from the parent project. |
| 159 | |
Han-Wen Nienhuys | cdde7a30 | 2019-07-24 12:19:16 +0200 | [diff] [blame] | 160 | [[receive.requireChangeId]]receive.requireChangeId:: |
| 161 | + |
| 162 | The `Require Change-Id in commit message` option defines whether a |
| 163 | link:user-changeid.html[Change-Id] in the commit message is required |
| 164 | for pushing a commit for review. If this option is set, trying to push |
| 165 | a commit for review that doesn't contain a Change-Id in the commit |
| 166 | message fails with link:error-missing-changeid.html[missing Change-Id |
| 167 | in commit message footer]. |
| 168 | |
| 169 | It is recommended to set this option and use a |
| 170 | link:user-changeid.html#create[commit-msg hook] (or other client side |
| 171 | tooling like EGit) to automatically generate Change-Id's for new |
| 172 | commits. This way the Change-Id is automatically in place when changes |
| 173 | are reworked or rebased and uploading new patch sets gets easy. |
| 174 | |
| 175 | If this option is not set, commits can be uploaded without a Change-Id, |
| 176 | but then users have to remember to copy the assigned Change-Id from the |
| 177 | change screen and insert it manually into the commit message when they |
| 178 | want to upload a second patch set. |
| 179 | |
| 180 | Default is `INHERIT`, which means that this property is inherited from |
| 181 | the parent project. The global default for new hosts is `true` |
| 182 | |
| 183 | This option is deprecated and future releases will behave as if this |
| 184 | is always `true`. |
| 185 | |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 186 | [[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit:: |
| 187 | + |
| 188 | Maximum allowed Git object size that receive-pack will accept. If an object |
| 189 | is larger than the given size the pack-parsing will abort and the push |
| 190 | operation will fail. If set to zero then there is no limit. |
| 191 | + |
| 192 | Project owners can use this setting to prevent developers from pushing |
David Pursehouse | 2e54868 | 2018-08-01 15:12:47 +0200 | [diff] [blame] | 193 | objects which are too large to Gerrit. This setting can also be set in |
| 194 | `gerrit.config` globally (link:config-gerrit.html#receive.maxObjectSizeLimit[ |
| 195 | receive.maxObjectSizeLimit]). |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 196 | + |
David Pursehouse | d508ef0 | 2018-08-03 15:09:56 +0100 | [diff] [blame] | 197 | The project specific setting in `project.config` may not set a value higher |
| 198 | than the global limit (if configured). In other words, it is only honored when |
| 199 | it further reduces the global limit. |
| 200 | + |
David Pursehouse | 3f9c740 | 2018-09-05 18:43:03 +0900 | [diff] [blame] | 201 | When link:config-gerrit.html#receive.inheritProjectMaxObjectSizeLimit[ |
| 202 | `receive.inheritProjectmaxObjectSizeLimit`] is enabled in the global config, |
| 203 | the value is inherited from the parent project. Otherwise, it is not inherited |
| 204 | and must be explicitly set per project. |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 205 | + |
| 206 | Default is zero. |
| 207 | + |
| 208 | Common unit suffixes of k, m, or g are supported. |
| 209 | |
Rob Ward | 2cf1295 | 2014-01-26 20:38:12 +0000 | [diff] [blame] | 210 | [[receive.checkReceivedObjects]]receive.checkReceivedObjects:: |
| 211 | + |
| 212 | Controls whether or not the JGit functionality for checking received objects |
| 213 | is enabled. |
| 214 | + |
| 215 | By default Gerrit checks the validity of git objects. Setting this variable to |
| 216 | false should not be used unless a project with history containing invalid |
| 217 | objects needs to be pushed into a Gerrit repository. |
| 218 | + |
| 219 | This functionality is provided as some other git implementations have allowed |
| 220 | bad history to be written into git repositories. If these repositories need pushing |
| 221 | up to Gerrit then the JGit checks need to be disabled. |
| 222 | + |
| 223 | The default value for this is true, false disables the checks. |
| 224 | |
Dave Borowitz | 5170e0f | 2015-06-18 21:05:29 -0400 | [diff] [blame] | 225 | [[receive.enableSignedPush]]receive.enableSignedPush:: |
| 226 | + |
| 227 | Controls whether server-side signed push validation is enabled on the |
| 228 | project. Only has an effect if signed push validation is enabled on the |
| 229 | server; see the link:config-gerrit.html#receive.enableSignedPush[global |
| 230 | configuration] for details. |
| 231 | + |
| 232 | Default is `INHERIT`, which means that this property is inherited from |
| 233 | the parent project. |
| 234 | |
Dave Borowitz | 0543c73 | 2015-10-20 10:35:26 -0400 | [diff] [blame] | 235 | [[receive.requireSignedPush]]receive.requireSignedPush:: |
| 236 | + |
| 237 | Controls whether server-side signed push validation is required on the |
| 238 | project. Only has an effect if signed push validation is enabled on the |
David Pursehouse | ab5383f | 2018-09-14 08:23:10 +0900 | [diff] [blame] | 239 | server, and link:#receive.enableSignedPush[`receive.enableSignedPush`] is |
| 240 | set on the project. See the |
| 241 | link:config-gerrit.html#receive.enableSignedPush[global configuration] |
| 242 | for details. |
Dave Borowitz | 0543c73 | 2015-10-20 10:35:26 -0400 | [diff] [blame] | 243 | + |
| 244 | Default is `INHERIT`, which means that this property is inherited from |
| 245 | the parent project. |
| 246 | |
Saša Živkov | 225b7a7 | 2015-11-17 17:37:43 +0100 | [diff] [blame] | 247 | [[receive.rejectImplicitMerges]]receive.rejectImplicitMerges:: |
| 248 | + |
| 249 | Controls whether a check for implicit merges will be performed when changes are |
| 250 | pushed for review. An implicit merge is a case where merging an open change |
| 251 | would implicitly merge another branch into the target branch. Typically, this |
| 252 | happens when a change is done on master and, by mistake, pushed to a stable branch |
| 253 | for review. When submitting such change, master would be implicitly merged into |
| 254 | stable without anyone noticing that. When this option is set to 'true' Gerrit |
| 255 | will reject the push if an implicit merge is detected. |
| 256 | + |
| 257 | This check is only done for non-merge commits, merge commits are not subject of |
| 258 | the implicit merge check. |
| 259 | + |
| 260 | Default is `INHERIT`, which means that this property is inherited from |
| 261 | the parent project. |
| 262 | |
Changcheng Xiao | 81a0df9 | 2019-01-15 18:27:58 +0100 | [diff] [blame] | 263 | [[receive.createNewChangeForAllNotInTarget]]receive.createNewChangeForAllNotInTarget:: |
| 264 | + |
| 265 | The `create-new-change-for-all-not-in-target` option provides a |
| 266 | convenience for selecting link:user-upload.html#base[the merge base] |
| 267 | by setting it automatically to the target branch's tip so you can |
| 268 | create new changes for all commits not in the target branch. |
| 269 | |
| 270 | This option is disabled if the tip of the push is a merge commit. |
| 271 | |
| 272 | This option also only works if there are no merge commits in the |
| 273 | commit chain, in such cases it fails warning the user that such |
| 274 | pushes can only be performed by manually specifying |
| 275 | link:user-upload.html#base[bases] |
| 276 | |
| 277 | This option is useful if you want to push a change to your personal |
| 278 | branch first and for review to another branch for example. Or in cases |
| 279 | where a commit is already merged into a branch and you want to create |
| 280 | a new open change for that commit on another branch. |
| 281 | |
Changcheng Xiao | d089b4a | 2017-08-10 14:05:22 +0200 | [diff] [blame] | 282 | [[change-section]] |
| 283 | === Change section |
| 284 | |
| 285 | The change section includes configuration for project-specific change settings: |
| 286 | |
| 287 | [[change.privateByDefault]]change.privateByDefault:: |
| 288 | + |
| 289 | Controls whether all new changes in the project are set as private by default. |
| 290 | + |
| 291 | Note that a new change will be public if the `is_private` field in |
| 292 | link:rest-api-changes.html#change-input[ChangeInput] is set to `false` explicitly |
| 293 | when calling the link:rest-api-changes.html#create-change[CreateChange] REST API |
| 294 | or the `remove-private` link:user-upload.html#private[PushOption] is used during |
| 295 | the Git push. |
| 296 | + |
| 297 | Default is `INHERIT`, which means that this property is inherited from |
| 298 | the parent project. |
| 299 | |
David Ostrovsky | 9690994 | 2018-06-10 08:30:33 +0200 | [diff] [blame] | 300 | [[change.workInProgressByDefault]]change.workInProgressByDefault:: |
| 301 | + |
| 302 | Controls whether all new changes in the project are set as WIP by default. |
| 303 | + |
| 304 | Note that a new change will be ready if the `workInProgress` field in |
| 305 | link:rest-api-changes.html#change-input[ChangeInput] is set to `false` explicitly |
| 306 | when calling the link:rest-api-changes.html#create-change[CreateChange] REST API |
| 307 | or the `ready` link:user-upload.html#wip[PushOption] is used during |
| 308 | the Git push. |
| 309 | + |
| 310 | Default is `INHERIT`, which means that this property is inherited from |
| 311 | the parent project. |
| 312 | |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 313 | [[submit-section]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 314 | === Submit section |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 315 | |
| 316 | The submit section includes configuration of project-specific |
| 317 | submit settings: |
| 318 | |
| 319 | - 'mergeContent': Defines whether to automatically merge changes. Valid values |
| 320 | are 'true', 'false', or 'INHERIT'. Default is 'INHERIT'. |
| 321 | |
Sebastian Schuberth | 28705d3 | 2019-04-25 11:52:49 +0200 | [diff] [blame] | 322 | - 'action': defines the link:#submit-type[submit type]. Valid |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 323 | values are 'fast forward only', 'merge if necessary', 'rebase if necessary', |
David Pursehouse | 91203c9 | 2019-07-16 08:49:29 +0900 | [diff] [blame] | 324 | 'rebase always', 'merge always' and 'cherry pick'. The default is 'merge if necessary'. |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 325 | |
Patrick Hiesel | 5a31635 | 2017-06-22 15:38:06 +0200 | [diff] [blame] | 326 | - 'matchAuthorToCommitterDate': Defines whether to the author date will be changed to match the |
| 327 | submitter date upon submit, so that git log shows when the change was submitted instead of when the |
| 328 | author last committed. Valid values are 'true', 'false', or 'INHERIT'. The default is 'INHERIT'. |
| 329 | This option only takes effect in submit strategies which already modify the commit, i.e. |
| 330 | Cherry Pick, Rebase Always, and (perhaps) Rebase If Necessary. |
| 331 | |
Patrick Hiesel | dc285c7 | 2018-01-08 17:20:15 +0100 | [diff] [blame] | 332 | - 'rejectEmptyCommit': Defines whether empty commits should be rejected when a change is merged. |
| 333 | Changes might not seem empty at first but when attempting to merge, rebasing can lead to an empty |
Dave Borowitz | 6266174 | 2018-08-15 15:28:51 -0700 | [diff] [blame] | 334 | commit. If this option is set to 'true' the merge would fail. An empty commit is still allowed as |
| 335 | the initial commit on a branch. |
Patrick Hiesel | dc285c7 | 2018-01-08 17:20:15 +0100 | [diff] [blame] | 336 | |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 337 | Merge strategy |
| 338 | |
| 339 | |
| 340 | [[access-section]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 341 | === Access section |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 342 | |
| 343 | Each +access+ section includes a reference and access rights connected |
| 344 | to groups. Each group listed must exist in the link:#file-groups[+groups+ file]. |
| 345 | |
| 346 | Please refer to the |
| 347 | link:access-control.html#access_categories[Access Categories] |
| 348 | documentation for a full list of available access rights. |
| 349 | |
| 350 | |
Shawn Pearce | 9cfcebd | 2014-04-25 16:41:12 -0700 | [diff] [blame] | 351 | [[mimetype-section]] |
| 352 | === MIME Types section |
| 353 | |
| 354 | The +mimetype+ section may be configured to force the web code |
| 355 | reviewer to return certain MIME types by file path. MIME types |
| 356 | may be used to activate syntax highlighting. |
| 357 | |
| 358 | ---- |
| 359 | [mimetype "text/x-c"] |
| 360 | path = *.pkt |
| 361 | [mimetype "text/x-java"] |
| 362 | path = api/current.txt |
| 363 | ---- |
| 364 | |
| 365 | |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 366 | [[capability-section]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 367 | === Capability section |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 368 | |
| 369 | The +capability+ section only appears once, and only in the +All-Projects+ |
| 370 | repository. It controls Gerrit administration capabilities that are configured |
| 371 | on a global level. |
| 372 | |
| 373 | Please refer to the |
| 374 | link:access-control.html#global_capabilities[Global Capabilities] |
| 375 | documentation for a full list of available capabilities. |
| 376 | |
David Myllykangas | b3ccec6 | 2015-01-21 15:41:13 +0100 | [diff] [blame] | 377 | [[label-section]] |
| 378 | === Label section |
| 379 | |
| 380 | Please refer to link:config-labels.html#label_custom[Custom Labels] documentation. |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 381 | |
Saša Živkov | 944b838 | 2014-05-08 14:02:15 +0200 | [diff] [blame] | 382 | [[branchOrder-section]] |
| 383 | === branchOrder section |
| 384 | |
| 385 | Defines a branch ordering which is used for backporting of changes. |
| 386 | Backporting will be offered for a change (in the Gerrit UI) for all |
| 387 | more stable branches where the change can merge cleanly. |
| 388 | |
| 389 | [[branchOrder.branch]]branchOrder.branch:: |
| 390 | + |
| 391 | A branch name, typically multiple values will be defined. The order of branch |
| 392 | names in this section defines the branch order. The topmost is considered to be |
| 393 | the least stable branch (typically the master branch) and the last one the |
| 394 | most stable (typically the last maintained release branch). |
| 395 | |
| 396 | Example: |
| 397 | |
| 398 | ---- |
| 399 | [branchOrder] |
| 400 | branch = master |
| 401 | branch = stable-2.9 |
| 402 | branch = stable-2.8 |
| 403 | branch = stable-2.7 |
| 404 | ---- |
| 405 | |
| 406 | The `branchOrder` section is inheritable. This is useful when multiple or all |
| 407 | projects follow the same branch rules. A `branchOrder` section in a child |
| 408 | project completely overrides any `branchOrder` section from a parent i.e. there |
| 409 | is no merging of `branchOrder` sections. A present but empty `branchOrder` |
| 410 | section removes all inherited branch order. |
| 411 | |
| 412 | Branches not listed in this section will not be included in the mergeability |
| 413 | check. If the `branchOrder` section is not defined then the mergeability of a |
| 414 | change into other branches will not be done. |
| 415 | |
Patrick Hiesel | 6db5afd | 2017-03-21 09:40:03 +0100 | [diff] [blame] | 416 | [[reviewer-section]] |
| 417 | === reviewer section |
| 418 | |
| 419 | Defines config options to adjust a project's reviewer workflow such as enabling |
| 420 | reviewers and CCs by email. |
| 421 | |
| 422 | [[reviewer.enableByEmail]]reviewer.enableByEmail:: |
| 423 | + |
| 424 | A boolean indicating if reviewers and CCs that do not currently have a Gerrit |
| 425 | account can be added to a change by providing their email address. |
| 426 | |
Patrick Hiesel | 6654293 | 2017-09-22 09:01:07 +0200 | [diff] [blame] | 427 | This setting only takes affect for changes that are readable by anonymous users. |
| 428 | |
Patrick Hiesel | 502b26c | 2017-03-29 14:19:23 +0200 | [diff] [blame] | 429 | Default is `INHERIT`, which means that this property is inherited from |
| 430 | the parent project. If the property is not set in any parent project, the |
| 431 | default value is `FALSE`. |
Saša Živkov | 944b838 | 2014-05-08 14:02:15 +0200 | [diff] [blame] | 432 | |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 433 | [[file-groups]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 434 | == The file +groups+ |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 435 | |
| 436 | Each group in this list is linked with its UUID so that renaming of |
| 437 | groups is possible without having to rewrite every +groups+ file |
| 438 | in every repository where it's used. |
| 439 | |
| 440 | This is what the default groups file for +All-Projects.git+ looks like: |
| 441 | |
| 442 | ---- |
| 443 | # UUID Group Name |
| 444 | # |
| 445 | 3d6da7dc4e99e6f6e5b5196e21b6f504fc530bba Administrators |
| 446 | global:Anonymous-Users Anonymous Users |
Khai Do | 5aaeee3 | 2014-09-05 10:14:32 -0700 | [diff] [blame] | 447 | global:Change-Owner Change Owner |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 448 | global:Project-Owners Project Owners |
| 449 | global:Registered-Users Registered Users |
| 450 | ---- |
| 451 | |
| 452 | This file can't be written to by the +git config+ command. |
| 453 | |
| 454 | In order to reference a group in +project.config+, it must be listed in |
| 455 | the +groups+ file. When editing permissions through the web UI this |
| 456 | file is maintained automatically, but when pushing updates to |
| 457 | +refs/meta/config+ this must be dealt with by hand. Gerrit will refuse |
| 458 | +project.config+ files that refer to groups not listed in +groups+. |
| 459 | |
| 460 | The UUID of a group can be found on the General tab of the group's page |
| 461 | in the web UI or via the +-v+ option to |
| 462 | link:cmd-ls-groups.html[the +ls-groups+ SSH command]. |
| 463 | |
| 464 | |
| 465 | [[file-rules_pl]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 466 | == The file +rules.pl+ |
Fredrik Luthander | a3cf354 | 2012-07-04 16:55:35 -0700 | [diff] [blame] | 467 | |
| 468 | The +rules.pl+ files allows you to replace or amend the default Prolog |
| 469 | rules that control e.g. what conditions need to be fulfilled for a |
| 470 | change to be submittable. This file content should be |
| 471 | interpretable by the 'Prolog Cafe' interpreter. |
| 472 | |
| 473 | You can read more about the +rules.pl+ file and the prolog rules on |
| 474 | link:prolog-cookbook.html[the Prolog cookbook page]. |
| 475 | |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 476 | [[submit-type]] |
| 477 | === Submit Type |
| 478 | |
| 479 | The method Gerrit uses to submit a change to a project can be |
| 480 | modified by any project owner through the project console, `Projects` > |
| 481 | `List` > my/project. In general, a submitted change is only merged if all |
| 482 | its dependencies are also submitted, with exceptions documented below. |
| 483 | The following submit types are supported: |
| 484 | |
| 485 | [[submit_type_inherit]] |
| 486 | * Inherit |
| 487 | + |
| 488 | This is the default for new projects, unless overridden by a global |
| 489 | link:config-gerrit.html#repository.name.defaultSubmitType[`defaultSubmitType` option]. |
| 490 | + |
| 491 | Inherit the submit type from the parent project. In `All-Projects`, this |
| 492 | is equivalent to link:#merge_if_necessary[Merge If Necessary]. |
| 493 | |
| 494 | [[fast_forward_only]] |
| 495 | * Fast Forward Only |
| 496 | + |
David Pursehouse | 8e2d81b | 2019-07-16 17:04:10 +0900 | [diff] [blame] | 497 | With this method Gerrit does not create merge commits on submitting a |
| 498 | change. Merge commits may still be submitted, but they must be created |
| 499 | on the client prior to uploading to Gerrit for review. |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 500 | + |
| 501 | To submit a change, the change must be a strict superset of the |
| 502 | destination branch. That is, the change must already contain the |
| 503 | tip of the destination branch at submit time. |
| 504 | |
| 505 | [[merge_if_necessary]] |
| 506 | * Merge If Necessary |
| 507 | + |
| 508 | If the change being submitted is a strict superset of the destination |
| 509 | branch, then the branch is fast-forwarded to the change. If not, |
| 510 | then a merge commit is automatically created. This is identical |
| 511 | to the classical `git merge` behavior, or `git merge --ff`. |
| 512 | |
| 513 | [[always_merge]] |
| 514 | * Always Merge |
| 515 | + |
| 516 | Always produce a merge commit, even if the change is a strict |
| 517 | superset of the destination branch. This is identical to the |
| 518 | behavior of `git merge --no-ff`, and may be useful if the |
| 519 | project needs to follow submits with `git log --first-parent`. |
| 520 | |
| 521 | [[cherry_pick]] |
| 522 | * Cherry Pick |
| 523 | + |
| 524 | Always cherry pick the patch set, ignoring the parent lineage |
| 525 | and instead creating a brand new commit on top of the current |
| 526 | branch head. |
| 527 | + |
| 528 | When cherry picking a change, Gerrit automatically appends onto the |
| 529 | end of the commit message a short summary of the change's approvals, |
| 530 | and a URL link back to the change on the web. The committer header |
| 531 | is also set to the submitter, while the author header retains the |
| 532 | original patch set author. |
| 533 | + |
| 534 | Note that Gerrit ignores dependencies between changes when using this |
| 535 | submit type unless |
| 536 | link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] |
| 537 | is enabled and depending changes share the same topic. So generally |
| 538 | submitters must remember to submit changes in the right order when using this |
| 539 | submit type. If all you want is extra information in the commit message, |
| 540 | consider using the Rebase Always submit strategy. |
| 541 | |
| 542 | [[rebase_if_necessary]] |
| 543 | * Rebase If Necessary |
| 544 | + |
| 545 | If the change being submitted is a strict superset of the destination |
| 546 | branch, then the branch is fast-forwarded to the change. If not, |
| 547 | then the change is automatically rebased and then the branch is |
| 548 | fast-forwarded to the change. |
David Pursehouse | 8e2d81b | 2019-07-16 17:04:10 +0900 | [diff] [blame] | 549 | + |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 550 | When Gerrit tries to do a merge, by default the merge will only |
| 551 | succeed if there is no path conflict. A path conflict occurs when |
| 552 | the same file has also been changed on the other side of the merge. |
| 553 | |
| 554 | [[rebase_always]] |
| 555 | * Rebase Always |
| 556 | + |
| 557 | Basically, the same as Rebase If Necessary, but it creates a new patchset even |
| 558 | if fast forward is possible AND like Cherry Pick it ensures footers such as |
| 559 | Change-Id, Reviewed-On, and others are present in resulting commit that is |
| 560 | merged. |
David Pursehouse | 8e2d81b | 2019-07-16 17:04:10 +0900 | [diff] [blame] | 561 | + |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 562 | Thus, Rebase Always can be considered similar to Cherry Pick, but with |
| 563 | the important distinction that Rebase Always does not ignore dependencies. |
| 564 | |
| 565 | [[content_merge]] |
David Pursehouse | cf5e35b | 2019-06-05 12:09:05 +0900 | [diff] [blame] | 566 | === Allow content merges |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 567 | If `Allow content merges` is enabled, Gerrit will try |
| 568 | to do a content merge when a path conflict occurs. |
David Pursehouse | e200d0d | 2019-06-05 12:08:19 +0900 | [diff] [blame] | 569 | |
| 570 | GERRIT |
| 571 | ------ |
| 572 | Part of link:index.html[Gerrit Code Review] |
| 573 | |
| 574 | SEARCHBOX |
| 575 | --------- |