Marian Harbach | ebeb154 | 2019-12-13 10:42:46 +0100 | [diff] [blame] | 1 | :linkattrs: |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 2 | = User Guide |
| 3 | |
| 4 | This is a Gerrit guide that is dedicated to Gerrit end-users. It |
| 5 | explains the standard Gerrit workflows and how a user can adapt Gerrit |
| 6 | to personal preferences. |
| 7 | |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 8 | It is expected that readers know about link:http://git-scm.com/[Git,role=external,window=_blank] |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 9 | and that they are familiar with basic git commands and workflows. |
| 10 | |
| 11 | [[gerrit]] |
| 12 | == What is Gerrit? |
| 13 | |
| 14 | Gerrit is a Git server that provides link:access-control.html[access |
| 15 | control] for the hosted Git repositories and a web front-end for doing |
| 16 | link:#code-review[code review]. Code review is a core functionality of |
| 17 | Gerrit, but still it is optional and teams can decide to |
| 18 | link:#no-code-review[work without code review]. |
| 19 | |
| 20 | [[tools]] |
| 21 | == Tools |
| 22 | |
Janet Davies | f2c6f62 | 2018-03-29 10:40:09 -0700 | [diff] [blame] | 23 | Gerrit uses the git protocol. This means in order to work with Gerrit |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 24 | you do *not* need to install any Gerrit client, but having a regular |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 25 | git client, such as the link:http://git-scm.com/[git command line,role=external,window=_blank] or |
| 26 | link:http://eclipse.org/egit/[EGit,role=external,window=_blank] in Eclipse, is sufficient. |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 27 | |
| 28 | Still there are some client-side tools for Gerrit, which can be used |
| 29 | optionally: |
| 30 | |
Edwin Kempin | 4cb451e | 2015-05-08 09:07:51 +0200 | [diff] [blame] | 31 | * link:https://github.com/uwolfer/gerrit-intellij-plugin[Gerrit |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 32 | IntelliJ Plugin,role=external,window=_blank]: Gerrit integration with the |
| 33 | link:http://www.jetbrains.com/idea/[IntelliJ Platform,role=external,window=_blank] |
Edwin Kempin | 37a8ea7 | 2024-01-19 08:07:02 +0000 | [diff] [blame] | 34 | * link:https://opendev.org/ttygroup/gertty[gertty]: Console-based interface for Gerrit |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 35 | |
| 36 | [[clone]] |
| 37 | == Clone Gerrit Project |
| 38 | |
| 39 | Cloning a Gerrit project is done the same way as cloning any other git |
| 40 | repository by using the `git clone` command. |
| 41 | |
| 42 | .Clone Gerrit Project |
| 43 | ---- |
| 44 | $ git clone ssh://gerrithost:29418/RecipeBook.git RecipeBook |
| 45 | Cloning into RecipeBook... |
| 46 | ---- |
| 47 | |
| 48 | The URL for cloning the project can be found in the Gerrit web UI |
| 49 | under `Projects` > `List` > <project-name> > `General`. |
| 50 | |
| 51 | For git operations Gerrit supports the link:user-upload.html#ssh[SSH] |
| 52 | and the link:user-upload.html#http[HTTP/HTTPS] protocols. |
| 53 | |
| 54 | [NOTE] |
Gert van Dijk | dc4f8d1 | 2017-08-27 21:14:23 +0200 | [diff] [blame] | 55 | To use SSH you may need to link:user-upload.html#ssh[configure your SSH public |
| 56 | key in your `Settings`]. |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 57 | |
| 58 | [[code-review]] |
| 59 | == Code Review Workflow |
| 60 | |
| 61 | With Gerrit _Code Review_ means to link:#review-change[review] every |
| 62 | commit *before* it is accepted into the code base. The author of a code |
| 63 | modification link:user-upload.html#push_create[uploads a commit] as a |
| 64 | change to Gerrit. In Gerrit each change is stored in a |
| 65 | link:#change-ref[staging area] where it can be checked and reviewed. |
| 66 | Only when it is approved and submitted it gets applied to the code |
| 67 | base. If there is feedback on a change, the author can improve the code |
| 68 | modification by link:#upload-patch-set[amending the commit and |
| 69 | uploading the new commit as a new patch set]. This way a change is |
| 70 | improved iteratively and it is applied to the code base only when is |
| 71 | ready. |
| 72 | |
| 73 | [[upload-change]] |
| 74 | == Upload a Change |
| 75 | |
| 76 | Uploading a change to Gerrit is done by pushing a commit to Gerrit. The |
| 77 | commit must be pushed to a ref in the `refs/for/` namespace which |
| 78 | defines the target branch: `refs/for/<target-branch>`. |
| 79 | The magic `refs/for/` prefix allows Gerrit to differentiate commits |
| 80 | that are pushed for review from commits that are pushed directly into |
| 81 | the repository, bypassing code review. For the target branch it is |
| 82 | sufficient to specify the short name, e.g. `master`, but you can also |
| 83 | specify the fully qualified branch name, e.g. `refs/heads/master`. |
| 84 | |
| 85 | .Push for Code Review |
| 86 | ---- |
| 87 | $ git commit |
| 88 | $ git push origin HEAD:refs/for/master |
| 89 | |
| 90 | // this is the same as: |
| 91 | $ git commit |
| 92 | $ git push origin HEAD:refs/for/refs/heads/master |
| 93 | ---- |
| 94 | |
| 95 | .Push with bypassing Code Review |
| 96 | ---- |
| 97 | $ git commit |
| 98 | $ git push origin HEAD:master |
| 99 | |
| 100 | // this is the same as: |
| 101 | $ git commit |
| 102 | $ git push origin HEAD:refs/heads/master |
| 103 | ---- |
| 104 | |
| 105 | [[push-fails]] |
| 106 | [NOTE] |
| 107 | If pushing to Gerrit fails consult the Gerrit documentation that |
| 108 | explains the link:error-messages.html[error messages]. |
| 109 | |
| 110 | [[change-ref]] |
| 111 | When a commit is pushed for review, Gerrit stores it in a staging area |
David Pursehouse | f949a35 | 2020-04-19 16:09:44 +0900 | [diff] [blame] | 112 | which is a branch in the special `refs/changes/` namespace. Understanding |
| 113 | the format of this ref is not required for working with Gerrit, but it |
| 114 | is explained below. |
| 115 | |
| 116 | A change ref has the format `refs/changes/X/Y/Z` where `X` is the last |
| 117 | two digits of the change number, `Y` is the entire change number, and `Z` |
| 118 | is the patch set. For example, if the change number is |
David Pursehouse | beb7449 | 2020-04-29 08:01:37 +0900 | [diff] [blame] | 119 | link:https://gerrit-review.googlesource.com/c/gerrit/+/263270[263270,role=external,window=_blank], |
David Pursehouse | f949a35 | 2020-04-19 16:09:44 +0900 | [diff] [blame] | 120 | the ref would be `refs/changes/70/263270/2` for the second patch set. |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 121 | |
| 122 | [[fetch-change]] |
| 123 | Using the change ref git clients can fetch the corresponding commit, |
| 124 | e.g. for local verification. |
| 125 | |
| 126 | .Fetch Change |
| 127 | ---- |
| 128 | $ git fetch https://gerrithost/myProject refs/changes/74/67374/2 && git checkout FETCH_HEAD |
| 129 | ---- |
| 130 | |
| 131 | [NOTE] |
| 132 | The fetch command can be copied from the |
| 133 | link:user-review-ui.html#download[download commands] in the change |
| 134 | screen. |
| 135 | |
| 136 | The `refs/for/` prefix is used to map the Gerrit concept of |
| 137 | "Pushing for Review" to the git protocol. For the git client it looks |
| 138 | like every push goes to the same branch, e.g. `refs/for/master` but in |
| 139 | fact for each commit that is pushed to this ref Gerrit creates a new |
| 140 | branch under the `refs/changes/` namespace. In addition Gerrit creates |
| 141 | an open change. |
| 142 | |
| 143 | [[change]] |
| 144 | A change consists of a link:user-changeid.html[Change-Id], meta data |
| 145 | (owner, project, target branch etc.), one or more patch sets, comments |
| 146 | and votes. A patch set is a git commit. Each patch set in a change |
| 147 | represents a new version of the change and replaces the previous patch |
| 148 | set. Only the latest patch set is relevant. This means all failed |
| 149 | iterations of a change will never be applied to the target branch, but |
| 150 | only the last patch set that is approved is integrated. |
| 151 | |
| 152 | [[change-id]] |
| 153 | The Change-Id is important for Gerrit to know whether a commit that is |
| 154 | pushed for code review should create a new change or whether it should |
| 155 | create a new patch set for an existing change. |
| 156 | |
| 157 | The Change-Id is a SHA-1 that is prefixed with an uppercase `I`. It is |
| 158 | specified as footer in the commit message (last paragraph): |
| 159 | |
| 160 | ---- |
| 161 | Improve foo widget by attaching a bar. |
| 162 | |
| 163 | We want a bar, because it improves the foo by providing more |
| 164 | wizbangery to the dowhatimeanery. |
| 165 | |
| 166 | Bug: #42 |
| 167 | Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b |
| 168 | Signed-off-by: A. U. Thor <author@example.com> |
| 169 | ---- |
| 170 | |
| 171 | If a commit that has a Change-Id in its commit message is pushed for |
| 172 | review, Gerrit checks if a change with this Change-Id already exists |
| 173 | for this project and target branch, and if yes, Gerrit creates a new |
| 174 | patch set for this change. If not, a new change with the given |
| 175 | Change-Id is created. |
| 176 | |
| 177 | If a commit without Change-Id is pushed for review, Gerrit creates a |
| 178 | new change and generates a Change-Id for it. Since in this case the |
| 179 | Change-Id is not included in the commit message, it must be manually |
| 180 | inserted when a new patch set should be uploaded. Most projects already |
| 181 | link:project-configuration.html#require-change-id[require a Change-Id] |
| 182 | when pushing the very first patch set. This reduces the risk of |
| 183 | accidentally creating a new change instead of uploading a new patch |
| 184 | set. Any push without Change-Id then fails with |
| 185 | link:error-missing-changeid.html[missing Change-Id in commit message |
Martin Wallgren | 2db1ecc | 2018-01-17 08:49:38 +0100 | [diff] [blame] | 186 | footer]. |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 187 | |
| 188 | Amending and rebasing a commit preserves the Change-Id so that the new |
| 189 | commit automatically becomes a new patch set of the existing change, |
| 190 | when it is pushed for review. |
| 191 | |
| 192 | .Push new Patch Set |
| 193 | ---- |
| 194 | $ git commit --amend |
| 195 | $ git push origin HEAD:refs/for/master |
| 196 | ---- |
| 197 | |
| 198 | Change-Ids are unique for a branch of a project. E.g. commits that fix |
| 199 | the same issue in different branches should have the same Change-Id, |
| 200 | which happens automatically if a commit is cherry-picked to another |
| 201 | branch. This way you can link:user-search.html[search] by the Change-Id |
| 202 | in the Gerrit web UI to find a fix in all branches. |
| 203 | |
| 204 | Change-Ids can be created automatically by installing the `commit-msg` |
| 205 | hook as described in the link:user-changeid.html#creation[Change-Id |
| 206 | documentation]. |
| 207 | |
| 208 | Instead of manually installing the `commit-msg` hook for each git |
| 209 | repository, you can copy it into the |
| 210 | link:http://git-scm.com/docs/git-init#_template_directory[git template |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 211 | directory,role=external,window=_blank]. Then it is automatically copied to every newly cloned |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 212 | repository. |
| 213 | |
| 214 | [[review-change]] |
| 215 | == Review Change |
| 216 | |
| 217 | After link:#upload-change[uploading a change for review] reviewers can |
| 218 | inspect it via the Gerrit web UI. Reviewers can see the code delta and |
| 219 | link:user-review-ui.html#inline-comments[comment directly in the code] |
| 220 | on code blocks or lines. They can also link:user-review-ui.html#reply[ |
| 221 | post summary comments and vote on review labels]. The |
| 222 | link:user-review-ui.html[documentation of the review UI] explains the |
| 223 | screens and controls for doing code reviews. |
| 224 | |
| 225 | There are several options to control how patch diffs should be |
| 226 | rendered. Users can configure their preferences in the |
| 227 | link:user-review-ui.html#diff-preferences[diff preferences]. |
| 228 | |
| 229 | [[upload-patch-set]] |
| 230 | == Upload a new Patch Set |
| 231 | |
| 232 | If there is feedback from code review and a change should be improved a |
| 233 | new patch set with the reworked code should be uploaded. |
| 234 | |
| 235 | This is done by amending the commit of the last patch set. If needed |
| 236 | this commit can be fetched from Gerrit by using the fetch command from |
| 237 | the link:user-review-ui.html#download[download commands] in the change |
| 238 | screen. |
| 239 | |
| 240 | It is important that the commit message contains the |
| 241 | link:user-changeid.html[Change-Id] of the change that should be updated |
| 242 | as a footer (last paragraph). Normally the commit message already |
| 243 | contains the correct Change-Id and the Change-Id is preserved when the |
| 244 | commit is amended. |
| 245 | |
| 246 | .Push Patch Set |
| 247 | ---- |
| 248 | // fetch and checkout the change |
| 249 | // (checkout command copied from change screen) |
| 250 | $ git fetch https://gerrithost/myProject refs/changes/74/67374/2 && git checkout FETCH_HEAD |
| 251 | |
| 252 | // rework the change |
| 253 | $ git add <path-of-reworked-file> |
| 254 | ... |
| 255 | |
| 256 | // amend commit |
| 257 | $ git commit --amend |
| 258 | |
| 259 | // push patch set |
| 260 | $ git push origin HEAD:refs/for/master |
| 261 | ---- |
| 262 | |
| 263 | [NOTE] |
| 264 | Never amend a commit that is already part of a central branch. |
| 265 | |
| 266 | Pushing a new patch set triggers email notification to the reviewers. |
| 267 | |
| 268 | [[multiple-features]] |
| 269 | == Developing multiple Features in parallel |
| 270 | |
| 271 | Code review takes time, which can be used by the change author to |
| 272 | implement other features. Each feature should be implemented in its own |
| 273 | local feature branch that is based on the current HEAD of the target |
| 274 | branch. This way there is no dependency to open changes and new |
| 275 | features can be reviewed and applied independently. If wanted, it is |
| 276 | also possible to base a new feature on an open change. This will create |
| 277 | a dependency between the changes in Gerrit and each change can only be |
| 278 | applied if all its predecessor are applied as well. Dependencies |
| 279 | between changes can be seen from the |
Peter DeLong | 553bf20 | 2023-09-30 11:29:54 -0400 | [diff] [blame] | 280 | link:user-review-ui.html#related-changes[Related Changes] tab on |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 281 | the change screen. |
| 282 | |
| 283 | [[watch]] |
| 284 | == Watching Projects |
| 285 | |
| 286 | To get to know about new changes you can link:user-notify.html#user[ |
| 287 | watch the projects] that you are interested in. For watched projects |
| 288 | Gerrit sends you email notifications when a change is uploaded or |
| 289 | modified. You can decide on which events you want to be notified and |
| 290 | you can filter the notifications by using link:user-search.html[change |
| 291 | search expressions]. For example '+branch:master file:^.*\.txt$+' would |
| 292 | send you email notifications only for changes in the master branch that |
| 293 | touch a 'txt' file. |
| 294 | |
| 295 | It is common that the members of a project team watch their own |
| 296 | projects and then pick the changes that are interesting to them for |
| 297 | review. |
| 298 | |
| 299 | Project owners may also configure |
| 300 | link:intro-project-owner.html#notifications[notifications on |
| 301 | project-level]. |
| 302 | |
| 303 | [[adding-reviewers]] |
| 304 | == Adding Reviewers |
| 305 | |
| 306 | In the link:user-review-ui.html#reviewers[change screen] reviewers can |
| 307 | be added explicitly to a change. The added reviewer will then be |
| 308 | notified by email about the review request. |
| 309 | |
| 310 | Mainly this functionality is used to request the review of specific |
| 311 | person who is known to be an expert in the modified code or who is a |
| 312 | stakeholder of the implemented feature. Normally it is not needed to |
| 313 | explicitly add reviewers on every change, but you rather rely on the |
| 314 | project team to watch their project and to process the incoming changes |
| 315 | by importance, interest, time etc. |
| 316 | |
| 317 | There are also link:intro-project-owner.html#reviewers[plugins which |
| 318 | can add reviewers automatically] (e.g. by configuration or based on git |
| 319 | blame annotations). If this functionality is required it should be |
| 320 | discussed with the project owners and the Gerrit administrators. |
| 321 | |
| 322 | [[dashboards]] |
| 323 | == Dashboards |
| 324 | |
| 325 | Gerrit supports a wide range of link:user-search.html#search-operators[ |
| 326 | query operators] to search for changes by different criteria, e.g. by |
| 327 | status, change owner, votes etc. |
| 328 | |
| 329 | The page that shows the results of a change query has the change query |
| 330 | contained in its URL. This means you can bookmark this URL in your |
| 331 | browser to save the change query. This way it can be easily re-executed |
| 332 | later. |
| 333 | |
| 334 | Several change queries can be also combined into a dashboard. A |
| 335 | dashboard is a screen in Gerrit that presents the results of several |
| 336 | change queries in different sections, each section having a descriptive |
| 337 | title. |
| 338 | |
| 339 | A default dashboard is available under `My` > `Changes`. It has |
| 340 | sections to list outgoing reviews, incoming reviews and recently closed |
| 341 | changes. |
| 342 | |
| 343 | Users can also define link:user-dashboards.html#custom-dashboards[ |
| 344 | custom dashboards]. Dashboards can be bookmarked in a browser so that |
| 345 | they can be re-executed later. |
| 346 | |
| 347 | It is also possible to link:#my-menu[customize the My menu] and add |
| 348 | menu entries for custom queries or dashboards to it. |
| 349 | |
| 350 | Dashboards are very useful to define own views on changes, e.g. you can |
| 351 | have different dashboards for own contributions, for doing reviews or |
| 352 | for different sets of projects. |
| 353 | |
| 354 | [NOTE] |
| 355 | You can use the link:user-search.html#limit[limit] and |
| 356 | link:user-search.html#age[age] query operators to limit the result set |
| 357 | in a dashboard section. Clicking on the section title executes the |
| 358 | change query without the `limit` and `age` operator so that you can |
| 359 | inspect the full result set. |
| 360 | |
| 361 | Project owners can also define shared |
| 362 | link:user-dashboards.html#project-dashboards[dashboards on |
| 363 | project-level]. The project dashboards can be seen in the web UI under |
| 364 | `Projects` > `List` > <project-name> > `Dashboards`. |
| 365 | |
Frank Borden | beda5c8 | 2022-07-07 13:41:02 +0200 | [diff] [blame] | 366 | All dashboards and search pages allow an action to be applied to multiple |
| 367 | changes at once. Select the changes with the checkboxes on the left side and |
| 368 | choose the action from the action bar at the top of the change section. |
| 369 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 370 | [[submit]] |
| 371 | == Submit a Change |
| 372 | |
| 373 | Submitting a change means that the code modifications of the current |
| 374 | patch set are applied to the target branch. Submit requires the |
| 375 | link:access-control.html#category_submit[Submit] access right and is |
| 376 | done on the change screen by clicking on the |
| 377 | link:user-review-ui.html#submit[Submit] button. |
| 378 | |
| 379 | In order to be submittable changes must first be approved by |
| 380 | link:user-review-ui.html#vote[voting on the review labels]. By default |
| 381 | a change can only be submitted if it has a vote with the highest value |
| 382 | on each review label and no vote with the lowest value (veto vote). |
| 383 | Projects can configure link:intro-project-owner.html#labels[custom |
| 384 | labels] and link:intro-project-owner.html#submit-rules[custom submit |
| 385 | rules] to control when a change becomes submittable. |
| 386 | |
| 387 | How the code modification is applied to the target branch when a change |
| 388 | is submitted is controlled by the |
Changcheng Xiao | 2188598 | 2019-01-15 18:16:51 +0100 | [diff] [blame] | 389 | link:config-project-config.html#submit-type[submit type] which can be |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 390 | link:intro-project-owner.html#submit-type[configured on project-level]. |
| 391 | |
| 392 | Submitting a change may fail with conflicts. In this case you need to |
| 393 | link:#rebase[rebase] the change locally, resolve the conflicts and |
| 394 | upload the commit with the conflict resolution as new patch set. |
| 395 | |
| 396 | If a change cannot be merged due to path conflicts this is highlighted |
| 397 | on the change screen by a bold red `Cannot Merge` label. |
| 398 | |
| 399 | [[rebase]] |
| 400 | == Rebase a Change |
| 401 | |
| 402 | While a change is in review the HEAD of the target branch can evolve. |
| 403 | In this case the change can be rebased onto the new HEAD of the target |
| 404 | branch. When there are no conflicts the rebase can be done directly |
| 405 | from the link:user-review-ui.html#rebase[change screen], otherwise it |
| 406 | must be done locally. |
| 407 | |
| 408 | .Rebase a Change locally |
| 409 | ---- |
| 410 | // update the remote tracking branches |
| 411 | $ git fetch |
| 412 | |
| 413 | // fetch and checkout the change |
| 414 | // (checkout command copied from change screen) |
| 415 | $ git fetch https://gerrithost/myProject refs/changes/74/67374/2 && git checkout FETCH_HEAD |
| 416 | |
| 417 | // do the rebase |
| 418 | $ git rebase origin/master |
| 419 | |
| 420 | // resolve conflicts if needed and stage the conflict resolution |
| 421 | ... |
| 422 | $ git add <path-of-file-with-conflicts-resolved> |
| 423 | |
| 424 | // continue the rebase |
| 425 | $ git rebase --continue |
| 426 | |
| 427 | // push the commit with the conflict resolution as new patch set |
| 428 | $ git push origin HEAD:refs/for/master |
| 429 | ---- |
| 430 | |
| 431 | Doing a manual rebase is only necessary when there are conflicts that |
| 432 | cannot be resolved by Gerrit. If manual conflict resolution is needed |
| 433 | also depends on the link:intro-project-owner.html#submit-type[submit |
| 434 | type] that is configured for the project. |
| 435 | |
| 436 | Generally changes shouldn't be rebased without reason as it |
| 437 | increases the number of patch sets and creates noise with |
| 438 | notifications. However if a change is in review for a long time it may |
| 439 | make sense to rebase it from time to time, so that reviewers can see |
| 440 | the delta against the current HEAD of the target branch. It also shows |
| 441 | that there is still an interest in this change. |
| 442 | |
| 443 | [NOTE] |
| 444 | Never rebase commits that are already part of a central branch. |
| 445 | |
Kaushik Lingarkar | eb09fda | 2020-06-10 17:59:09 -0700 | [diff] [blame] | 446 | [[move]] |
| 447 | == Move a Change |
| 448 | |
| 449 | Changes can be link:rest-api-changes.html#move-change[moved] to a desired |
| 450 | destination branch in the same project. This is useful in cases where |
| 451 | development activity switches from one branch to another and there is a |
| 452 | need to move open changes on the inactive branch to the new active one. |
| 453 | Another useful case is to move changes from a newer branch back to an older |
| 454 | bugfix branch where an issue first appeared. |
| 455 | |
| 456 | Users can move a change only if they have link:access-control.html#category_abandon[ |
| 457 | abandon permission] on the change and link:access-control.html#category_push[ |
| 458 | push permission] on the destination branch. |
| 459 | |
| 460 | The move operation will not update the change's parent and users will have |
Orgad Shaneh | de3e312 | 2021-08-30 10:35:40 +0300 | [diff] [blame] | 461 | to link:#rebase[rebase] the change. |
Kaushik Lingarkar | eb09fda | 2020-06-10 17:59:09 -0700 | [diff] [blame] | 462 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 463 | [[abandon]] |
| 464 | [[restore]] |
| 465 | == Abandon/Restore a Change |
| 466 | |
| 467 | Sometimes during code review a change is found to be bad and it should |
| 468 | be given up. In this case the change can be |
| 469 | link:user-review-ui.html#abandon[abandoned] so that it doesn't appear |
| 470 | in list of open changes anymore. |
| 471 | |
| 472 | Abandoned changes can be link:user-review-ui.html#restore[restored] if |
| 473 | later they are needed again. |
| 474 | |
Kaushik Lingarkar | 4a711ed | 2019-11-12 13:53:29 -0800 | [diff] [blame] | 475 | [[cherrypickof]] |
| 476 | == Cherry-Pick changes of a Change |
| 477 | |
| 478 | When a change is created/updated using the 'cherry-pick' functionalty, |
| 479 | the original change and patchset details are recorded in the Change's |
| 480 | cherrypick field. This field cannot be set or updated by the user in |
| 481 | any way. It is set automatically after the cherry-pick operation completes |
| 482 | successfully. |
| 483 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 484 | [[topics]] |
| 485 | == Using Topics |
| 486 | |
| 487 | Changes can be grouped by topics. This is useful because it allows you |
| 488 | to easily find related changes by using the |
| 489 | link:user-search.html#topic[topic search operator]. Also on the change |
| 490 | screen link:user-review-ui.html#same-topic[changes with the same topic] |
| 491 | are displayed so that you can easily navigate between them. |
| 492 | |
| 493 | Often changes that together implement a feature or a user story are |
| 494 | group by a topic. |
| 495 | |
| 496 | Assigning a topic to a change can be done in the |
| 497 | link:user-review-ui.html#project-branch-topic[change screen]. |
| 498 | |
| 499 | It is also possible to link:user-upload.html#topic[set a topic on |
Dan Wang | 17ced40 | 2016-08-26 16:42:49 -0700 | [diff] [blame] | 500 | push], either by appending `%topic=...` to the ref name or through |
| 501 | the use of the command line flag `--push-option`, aliased to `-o`, |
| 502 | followed by `topic=...`. |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 503 | |
Dave Borowitz | c001251 | 2018-03-15 10:28:24 -0400 | [diff] [blame] | 504 | Gerrit may be link:config-gerrit.html#change.submitWholeTopic[configured] to |
| 505 | submit all changes in a topic together with a single click, even when topics |
| 506 | span multiple projects. |
| 507 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 508 | .Set Topic on Push |
| 509 | ---- |
| 510 | $ git push origin HEAD:refs/for/master%topic=multi-master |
Dan Wang | 17ced40 | 2016-08-26 16:42:49 -0700 | [diff] [blame] | 511 | |
| 512 | // this is the same as: |
| 513 | $ git push origin HEAD:refs/heads/master -o topic=multi-master |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 514 | ---- |
| 515 | |
Albert Cui | acef5c9 | 2021-02-26 19:42:27 +0000 | [diff] [blame] | 516 | For more information about using topics, see the user guide: |
| 517 | link:cross-repository-changes.html[Submitting Changes Across Repositories by using Topics]. |
| 518 | |
Dave Borowitz | 8fbaddf | 2018-03-15 10:35:46 -0400 | [diff] [blame] | 519 | [[hashtags]] |
| 520 | == Using Hashtags |
| 521 | |
| 522 | Hashtags are freeform strings associated with a change, like on social media |
| 523 | platforms. In Gerrit, you explicitly associate hashtags with changes using a |
| 524 | dedicated area of the UI; they are not parsed from commit messages or comments. |
| 525 | |
| 526 | Similar to topics, hashtags can be used to group related changes together, and |
| 527 | to search using the link:user-search.html#hashtag[`hashtag:`] operator. Unlike |
| 528 | topics, a change can have multiple hashtags, and they are only used for |
| 529 | informational grouping; changes with the same hashtags are not necessarily |
| 530 | submitted together. |
| 531 | |
Dave Borowitz | 8fbaddf | 2018-03-15 10:35:46 -0400 | [diff] [blame] | 532 | .Set Hashtag on Push |
| 533 | ---- |
| 534 | $ git push origin HEAD:refs/for/master%t=stable-bugfix |
| 535 | |
| 536 | // this is the same as: |
| 537 | $ git push origin HEAD:refs/heads/master -o t=stable-bugfix |
| 538 | ---- |
| 539 | |
Dave Borowitz | d2e4145 | 2017-10-26 08:06:23 -0400 | [diff] [blame] | 540 | [[wip]] |
| 541 | == Work-in-Progress Changes |
| 542 | |
| 543 | Work-in-Progress (WIP) changes are visible to anyone, but do not notify or |
| 544 | require an action from a reviewer. |
| 545 | |
| 546 | Specifically, when you mark a change as Work-in-Progress: |
| 547 | |
| 548 | * Reviewers are not notified for most operations, such as adding or removing, |
| 549 | posting comments, and so on. See the REST API documentation |
| 550 | link:rest-api-changes.html#set-review-notifications[tables] for more |
| 551 | information. |
| 552 | * The change does not show in reviewers' dashboards. |
| 553 | |
| 554 | WIP changes are useful when: |
| 555 | |
| 556 | * You have implemented only part of a change, but want to push your change |
| 557 | to the server to run tests or perform other actions before requesting |
| 558 | reviewer feedback. |
| 559 | * During a review, you realize you need to rework your change, and you |
| 560 | want to stop notifying reviewers of the change until you finish your |
| 561 | update. |
| 562 | |
| 563 | To set the status of a change to Work-in-Progress, you can use either |
| 564 | the command line or the user interface. To use the command line, append |
| 565 | `%wip` to your push request. |
| 566 | |
| 567 | ---- |
| 568 | $ git push origin HEAD:refs/for/master%wip |
| 569 | ---- |
David Pursehouse | 50016d9 | 2019-12-05 16:38:48 +0900 | [diff] [blame] | 570 | Alternatively, click *WIP* from the *More* menu on the Change screen. |
| 571 | The Change screen updates with a yellow header, indicating that |
| 572 | the change is in a Work-in-Progress state. |
Dave Borowitz | d2e4145 | 2017-10-26 08:06:23 -0400 | [diff] [blame] | 573 | |
| 574 | To mark the change as ready for review, append `%ready` to your push |
| 575 | request. |
| 576 | |
| 577 | ---- |
| 578 | $ git push origin HEAD:refs/for/master%ready |
| 579 | ---- |
Sven Selberg | 8609300 | 2020-06-04 17:41:23 +0200 | [diff] [blame] | 580 | There are two options for marking the change ready for review from the Change |
| 581 | screen: |
| 582 | |
| 583 | 1. Click *Start Review* (the primary action *Reply* is renamed when in WIP |
| 584 | state). |
| 585 | + |
| 586 | This will open the reply-modal and allow you to add reviewers and/or CC |
| 587 | before you start review. |
| 588 | |
| 589 | 2. Click button *Mark As Active*. |
| 590 | + |
| 591 | This will only change the state from WIP to ready, without opening the |
| 592 | reply-modal. |
Dave Borowitz | d2e4145 | 2017-10-26 08:06:23 -0400 | [diff] [blame] | 593 | |
David Ostrovsky | 6def400 | 2019-02-03 10:43:47 +0100 | [diff] [blame] | 594 | Change owners, project owners, site administrators and members of a group that |
David Ostrovsky | c3f6b14 | 2020-07-03 11:53:04 +0000 | [diff] [blame] | 595 | was granted link:access-control.html#category_toggle_work_in_progress_state[ |
| 596 | Toggle Work In Progress state] permission can mark changes as `work-in-progress` |
| 597 | and `ready`. |
David Ostrovsky | 4424245 | 2018-06-09 20:25:13 +0200 | [diff] [blame] | 598 | |
David Pursehouse | 4f5fa2a | 2017-04-05 12:08:05 +0900 | [diff] [blame] | 599 | [[private-changes]] |
| 600 | == Private Changes |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 601 | |
Edwin Kempin | e2fa2d6 | 2018-01-15 09:18:59 +0100 | [diff] [blame] | 602 | Private changes are changes that are only visible to their owners, reviewers |
| 603 | and users with the link:access-control.html#category_view_private_changes[ |
| 604 | View Private Changes] global capability. Private changes are useful in a number |
| 605 | of cases: |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 606 | |
Sven Selberg | 0384739 | 2019-01-16 14:59:24 +0100 | [diff] [blame] | 607 | * You want a set of collaborators to review the change before formal review |
| 608 | starts. By creating a Private change and adding only a selected few as |
| 609 | reviewers you can control who can see the change and get a first opinion |
| 610 | before opening up for all reviewers. |
| 611 | |
Sven Selberg | c956c41 | 2017-09-27 08:01:29 +0200 | [diff] [blame] | 612 | * You want to check what the change looks like before formal review starts. |
David Pursehouse | b7f9e2a | 2017-09-27 13:31:30 +0000 | [diff] [blame] | 613 | By marking the change private without reviewers, nobody can |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 614 | prematurely comment on your changes. |
| 615 | |
| 616 | * You want to use Gerrit to sync data between different devices. By |
| 617 | creating a private throwaway change without reviewers, you can push |
| 618 | from one device, and fetch to another device. |
| 619 | |
Edwin Kempin | 8bb24fe | 2019-09-27 10:51:42 +0200 | [diff] [blame] | 620 | Do *not* use private changes for making security fixes (see |
Edwin Kempin | 0118c5d | 2019-09-27 11:01:26 +0200 | [diff] [blame] | 621 | link:#private-changes-pitfalls[pitfalls] below). How to make security |
| 622 | fixes is explained link:#security-fixes[below]. |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 623 | |
| 624 | To create a private change, you push it with the `private` option. |
| 625 | |
| 626 | .Push a private change |
| 627 | ---- |
| 628 | $ git commit |
| 629 | $ git push origin HEAD:refs/for/master%private |
| 630 | ---- |
| 631 | |
| 632 | The change will remain private on subsequent pushes until you specify |
| 633 | the `remove-private` option. Alternatively, the web UI provides buttons |
| 634 | to mark a change private and non-private again. |
| 635 | |
David Pursehouse | 47f9d04 | 2017-04-12 14:28:14 +0900 | [diff] [blame] | 636 | When pushing a private change with a commit that is authored by another |
| 637 | user, the other user will not be automatically added as a reviewer and |
| 638 | must be explicitly added. |
| 639 | |
Edwin Kempin | 98ddc8a | 2017-02-21 11:56:08 +0100 | [diff] [blame] | 640 | For CI systems that must verify private changes, a special permission |
| 641 | can be granted |
| 642 | (link:access-control.html#category_view_private_changes[View Private Changes]). |
| 643 | In that case, care should be taken to prevent the CI system from |
| 644 | exposing secret details. |
| 645 | |
Edwin Kempin | 8bb24fe | 2019-09-27 10:51:42 +0200 | [diff] [blame] | 646 | [[private-changes-pitfalls]] |
David Pursehouse | 2ba3b5a | 2020-06-06 15:04:24 +0900 | [diff] [blame] | 647 | === Pitfalls |
Edwin Kempin | 8bb24fe | 2019-09-27 10:51:42 +0200 | [diff] [blame] | 648 | |
| 649 | If private changes are used, be aware of the following pitfalls: |
| 650 | |
| 651 | * If a private change gets merged the corresponding commit gets visible |
| 652 | for all users that can access the target branch and the private flag |
| 653 | from the change is automatically removed. This makes private changes |
| 654 | a bad choice for security fixes, as the security fix will be |
| 655 | accessible as soon as the change was merged, but for security issues |
| 656 | you want to keep an embargo until new releases have been made |
| 657 | available. |
| 658 | * If you push a non-private change on top of a private change the |
| 659 | commit of the private change gets implicitly visible through the |
| 660 | parent relationship of the follow-up change. |
| 661 | * If you have a series of private changes and share one with reviewers, |
| 662 | the reviewers can also see the commits of the predecessor private |
| 663 | changes through the commit parent relationship. |
Patrick Georgi | 7632c9a | 2021-11-17 20:56:09 +0000 | [diff] [blame] | 664 | * Users who would have permission to access the change except for its |
| 665 | private status and knowledge of its commit ID (e.g. through CI logs |
| 666 | or build artifacts containing build numbers) can fetch the code |
| 667 | using the commit ID. |
Edwin Kempin | 8bb24fe | 2019-09-27 10:51:42 +0200 | [diff] [blame] | 668 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 669 | [[inline-edit]] |
| 670 | == Inline Edit |
| 671 | |
| 672 | It is possible to link:user-inline-edit.html#editing-change[edit |
| 673 | changes inline] directly in the web UI. This is useful to make small |
| 674 | corrections immediately and publish them as a new patch set. |
| 675 | |
| 676 | It is also possible to link:user-inline-edit.html#create-change[create |
| 677 | new changes inline]. |
| 678 | |
Edwin Kempin | 5a2a338 | 2021-04-29 10:07:53 +0000 | [diff] [blame] | 679 | [[roles]] |
| 680 | == Roles |
| 681 | |
| 682 | Making and reviewing changes usually involves multiple users that |
| 683 | assume different roles: |
| 684 | |
| 685 | - Author: |
| 686 | + |
| 687 | The person who wrote the code change. Recorded as author in the Git |
| 688 | commit. |
| 689 | |
| 690 | - Committer: |
| 691 | + |
| 692 | The person who created the Git commit, e.g. the person that executed |
| 693 | the `git commit` command. Recorded as committer in the Git commit. |
| 694 | |
| 695 | - Uploader: |
| 696 | + |
| 697 | The user that uploaded the commit as a patch set to Gerrit, e.g. the |
Edwin Kempin | afe41c5 | 2021-10-15 08:44:23 +0200 | [diff] [blame] | 698 | user that executed the `git push` command. For commits that are created through |
| 699 | an action in the web UI the uploader is the user that triggered the action (e.g. |
| 700 | if a commit is created by clicking on the `REBASE` button, the user clicking on |
| 701 | the button becomes the uploader of the newly created commit). |
Edwin Kempin | 5a2a338 | 2021-04-29 10:07:53 +0000 | [diff] [blame] | 702 | + |
| 703 | The uploader of the first patch set is the change owner. |
| 704 | + |
| 705 | The uploader of the latest patch set, the user that uploaded the |
Edwin Kempin | c909a16 | 2021-10-15 08:38:14 +0200 | [diff] [blame] | 706 | current patch set, is relevant when |
| 707 | link:config-labels.html#label_ignoreSelfApproval[self approvals on labels are |
| 708 | ignored], as in this case approvals from the uploader of the latest patch set |
| 709 | are ignored. |
Edwin Kempin | 5a2a338 | 2021-04-29 10:07:53 +0000 | [diff] [blame] | 710 | |
| 711 | - Change Owner: |
| 712 | + |
| 713 | The user that created the change, e.g. uploaded the first patch set. |
| 714 | |
| 715 | - Reviewer: |
| 716 | + |
| 717 | A user that has reviewed the change or has been asked to review the change. |
| 718 | |
Edwin Kempin | 5a2a338 | 2021-04-29 10:07:53 +0000 | [diff] [blame] | 719 | Often one user assumes several of these roles, but it's possible that each role |
| 720 | is assumed by a different user. |
| 721 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 722 | [[project-administration]] |
| 723 | == Project Administration |
| 724 | |
| 725 | Every project has a link:intro-project-owner.html#project-owner[project |
| 726 | owner] that administrates the project. Project administration includes |
| 727 | the configuration of the project |
| 728 | link:intro-project-owner.html#access-rights[access rights], but project |
| 729 | owners have many more possibilities to customize the workflows for a |
| 730 | project which are described in the link:intro-project-owner.html[ |
| 731 | project owner guide]. |
| 732 | |
| 733 | [[no-code-review]] |
| 734 | == Working without Code Review |
| 735 | |
| 736 | Doing code reviews with Gerrit is optional and you can use Gerrit |
| 737 | without code review as a pure Git server. |
| 738 | |
| 739 | .Push with bypassing Code Review |
| 740 | ---- |
| 741 | $ git commit |
| 742 | $ git push origin HEAD:master |
| 743 | |
| 744 | // this is the same as: |
| 745 | $ git commit |
| 746 | $ git push origin HEAD:refs/heads/master |
| 747 | ---- |
| 748 | |
| 749 | [NOTE] |
| 750 | Bypassing code review must be enabled in the project access rights. The |
| 751 | project owner must allow it by assigning the |
| 752 | link:access-control.html#category_push_direct[Push] access right on the |
| 753 | target branch (`refs/heads/<branch-name>`). |
| 754 | |
| 755 | [NOTE] |
| 756 | If you bypass code review you always need to merge/rebase manually if |
| 757 | the tip of the destination branch has moved. Please keep this in mind |
| 758 | if you choose to not work with code review because you think it's |
| 759 | easier to avoid the additional complexity of the review workflow; it |
| 760 | might actually not be easier. |
| 761 | |
| 762 | [NOTE] |
| 763 | The project owner may enable link:user-upload.html#auto_merge[ |
| 764 | auto-merge on push] to benefit from the automatic merge/rebase on |
| 765 | server side while pushing directly into the repository. |
| 766 | |
Martin Fick | 21c557b | 2015-08-31 16:03:24 -0600 | [diff] [blame] | 767 | [[user-refs]] |
| 768 | == User Refs |
| 769 | |
| 770 | User configuration data such as link:#preferences[preferences] is |
| 771 | stored in the `All-Users` project under a per-user ref. The user's |
| 772 | ref is based on the user's account id which is an integer. The user |
| 773 | refs are sharded by the last two digits (`+nn+`) in the refname, |
| 774 | leading to refs of the format `+refs/users/nn/accountid+`. |
| 775 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 776 | [[preferences]] |
| 777 | == Preferences |
| 778 | |
| 779 | There are several options to control the rendering in the Gerrit web UI. |
| 780 | Users can configure their preferences under `Settings` > `Preferences`. |
Martin Fick | 21c557b | 2015-08-31 16:03:24 -0600 | [diff] [blame] | 781 | The user's preferences are stored in a `git config` style file named |
| 782 | `preferences.config` under the link:#user-refs[user's ref] in the |
| 783 | `All-Users` project. |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 784 | |
| 785 | The following preferences can be configured: |
| 786 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 787 | - [[page-size]]`Maximum Page Size`: |
| 788 | + |
| 789 | The maximum number of entries that are shown on one page, e.g. used |
| 790 | when paging through changes, projects, branches or groups. |
| 791 | |
| 792 | - [[date-time-format]]`Date/Time Format`: |
| 793 | + |
| 794 | The format that should be used to render dates and timestamps. |
| 795 | |
Edwin Kempin | 717aa5d | 2016-03-16 16:29:43 +0100 | [diff] [blame] | 796 | - [[email-notifications]]`Email Notifications`: |
| 797 | + |
| 798 | This setting controls the email notifications. |
| 799 | + |
Logan Hanks | c88e961 | 2017-09-25 10:17:56 -0700 | [diff] [blame] | 800 | ** [[cc-me]]`Every comment`: |
Edwin Kempin | 717aa5d | 2016-03-16 16:29:43 +0100 | [diff] [blame] | 801 | + |
| 802 | Email notifications are enabled and you get notified by email as CC |
| 803 | on comments that you write yourself. |
| 804 | + |
Youssef Elghareeb | 9dddbe0 | 2022-02-14 12:52:23 +0100 | [diff] [blame] | 805 | ** `Only comments left by others` |
| 806 | + |
| 807 | Email notifications are enabled for all activities excluding comments or |
| 808 | reviews authored by you. |
| 809 | + |
| 810 | ** `Only when I am in the attention set` |
| 811 | + |
| 812 | Email notifications are only sent if the recipient is in the attention set. |
| 813 | + |
| 814 | ** `None`: |
Edwin Kempin | 717aa5d | 2016-03-16 16:29:43 +0100 | [diff] [blame] | 815 | + |
| 816 | Email notifications are disabled. |
| 817 | |
Patrick Hiesel | 006578f | 2017-02-27 16:26:33 +0100 | [diff] [blame] | 818 | - [[email-format]]`Email Format`: |
| 819 | + |
| 820 | This setting controls the email format Gerrit sends. Note that this |
| 821 | setting has no effect if the administrator has disabled HTML emails |
| 822 | for the Gerrit instance. |
| 823 | + |
| 824 | ** `Plaintext Only`: |
| 825 | + |
| 826 | Email notifications contain only plaintext content. |
| 827 | + |
| 828 | ** `HTML and Plaintext`: |
| 829 | + |
| 830 | Email notifications contain both HTML and plaintext content. |
| 831 | |
Edwin Kempin | d540a25 | 2016-09-08 13:29:03 +0200 | [diff] [blame] | 832 | - [[default-base-for-merges]]`Default Base For Merges`: |
| 833 | + |
| 834 | This setting controls which base should be pre-selected in the |
| 835 | `Diff Against` drop-down list when the change screen is opened for a |
| 836 | merge commit. |
| 837 | + |
| 838 | ** `Auto Merge`: |
| 839 | + |
| 840 | Pre-selects `Auto Merge` in the `Diff Against` drop-down list when the |
| 841 | change screen is opened for a merge commit. |
| 842 | + |
| 843 | ** `First Parent`: |
| 844 | + |
| 845 | Pre-selects `Parent 1` in the `Diff Against` drop-down list when the |
| 846 | change screen is opened for a merge commit. |
| 847 | + |
| 848 | |
Edwin Kempin | 717aa5d | 2016-03-16 16:29:43 +0100 | [diff] [blame] | 849 | - [[diff-view]]`Diff View`: |
| 850 | + |
| 851 | Whether the Side-by-Side diff view or the Unified diff view should be |
| 852 | shown when clicking on a file path in the change screen. |
| 853 | |
Sebastian Schuberth | 1ab17d8 | 2016-07-28 17:21:29 +0200 | [diff] [blame] | 854 | - [[show-site-header]]`Show Site Header / Footer`: |
Edwin Kempin | 717aa5d | 2016-03-16 16:29:43 +0100 | [diff] [blame] | 855 | + |
Sebastian Schuberth | 1ab17d8 | 2016-07-28 17:21:29 +0200 | [diff] [blame] | 856 | Whether the site header and footer should be shown. |
Edwin Kempin | 717aa5d | 2016-03-16 16:29:43 +0100 | [diff] [blame] | 857 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 858 | - [[relative-dates]]`Show Relative Dates In Changes Table`: |
| 859 | + |
| 860 | Whether timestamps in change lists and dashboards should be shown as |
| 861 | relative timestamps, e.g. '12 days ago' instead of absolute timestamps |
| 862 | such as 'Apr 15'. |
| 863 | |
| 864 | - [[change-size-bars]]`Show Change Sizes As Colored Bars`: |
| 865 | + |
| 866 | Whether change sizes should be visualized as colored bars. If disabled |
| 867 | the numbers of added and deleted lines are shown as text, e.g. |
| 868 | '+297, -63'. |
| 869 | |
| 870 | - [[show-change-number]]`Show Change Number In Changes Table`: |
| 871 | + |
Sven Selberg | 45ca178 | 2023-01-09 08:32:27 +0000 | [diff] [blame] | 872 | Whether in change lists and dashboards an `ID` column with the change numbers |
| 873 | should be shown. |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 874 | |
| 875 | - [[mute-common-path-prefixes]]`Mute Common Path Prefixes In File List`: |
| 876 | + |
| 877 | Whether common path prefixes in the file list on the change screen |
| 878 | should be link:user-review-ui.html#repeating-path-segments[grayed out]. |
| 879 | |
Edwin Kempin | 717aa5d | 2016-03-16 16:29:43 +0100 | [diff] [blame] | 880 | - [[inline-signed-off]]`Insert Signed-off-by Footer For Inline Edit Changes`: |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 881 | + |
Edwin Kempin | 717aa5d | 2016-03-16 16:29:43 +0100 | [diff] [blame] | 882 | Whether a `Signed-off-by` footer should be automatically inserted into |
| 883 | changes that are created from the web UI (e.g. by the `Create Change` |
| 884 | and `Edit Config` buttons on the project screen, and the `Follow-Up` |
| 885 | button on the change screen). |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 886 | |
Maxime Guerreiro | 596a913 | 2018-04-06 09:04:16 +0000 | [diff] [blame] | 887 | - [[publish-comments-on-push]]`Publish comments on push`: |
Dave Borowitz | d6ee48e | 2017-04-27 10:32:42 -0400 | [diff] [blame] | 888 | + |
| 889 | Whether to publish any outstanding draft comments by default when pushing |
| 890 | updates to open changes. This preference just sets the default; the behavior can |
| 891 | still be overridden using a link:user-upload.html#publish-comments[push option]. |
| 892 | |
Michael Zhou | 2e9aca1 | 2016-03-17 22:45:40 -0400 | [diff] [blame] | 893 | - [[use-flash]]`Use Flash Clipboard Widget`: |
| 894 | + |
| 895 | Whether the Flash clipboard widget should be used. If enabled and the Flash |
| 896 | plugin is available, Gerrit offers a copy-to-clipboard icon next to IDs and |
| 897 | commands that need to be copied frequently, such as the Change-Ids, commit IDs |
| 898 | and download commands. Note that this option is only shown if the Flash plugin |
| 899 | is available and the JavaScript Clipboard API is unavailable. |
| 900 | |
David Ostrovsky | 821c532 | 2018-06-10 16:36:42 +0200 | [diff] [blame] | 901 | - [[work-in-progress-by-default]]`Set new changes work-in-progress`: |
| 902 | + |
| 903 | Whether new changes are uploaded as work-in-progress per default. This |
| 904 | preference just sets the default; the behavior can still be overridden using a |
| 905 | link:user-upload.html#wip[push option]. |
| 906 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 907 | [[my-menu]] |
| 908 | In addition it is possible to customize the menu entries of the `My` |
| 909 | menu. This can be used to make the navigation to frequently used |
| 910 | screens, e.g. configured link:#dashboards[dashboards], quick. |
| 911 | |
Patrick Hiesel | 4362c4f | 2017-02-14 11:52:09 +0100 | [diff] [blame] | 912 | [[reply-by-email]] |
| 913 | == Reply by Email |
| 914 | |
| 915 | Gerrit sends out email notifications to users and supports parsing back replies |
David Pursehouse | aae0c69 | 2017-04-04 15:10:06 +0900 | [diff] [blame] | 916 | on some of them (when link:config-gerrit.html#receiveemail[configured]). |
Patrick Hiesel | 4362c4f | 2017-02-14 11:52:09 +0100 | [diff] [blame] | 917 | |
| 918 | Gerrit supports replies on these notification emails: |
| 919 | |
| 920 | * Notifications about new comments |
| 921 | * Notifications about new labels that were applied or removed |
| 922 | |
| 923 | While Gerrit supports a wide range of email clients, the following ones have |
| 924 | been tested and are known to work: |
| 925 | |
| 926 | * Gmail |
| 927 | * Gmail Mobile |
| 928 | |
| 929 | Gerrit supports parsing back all comment types that can be applied to a change |
| 930 | via the WebUI: |
| 931 | |
| 932 | * Change messages |
| 933 | * Inline comments |
| 934 | * File comments |
| 935 | |
| 936 | Please note that comments can only be sent in reply to a comment in the original |
| 937 | notification email, while the change message is independent of those. |
| 938 | |
| 939 | Gerrit supports parsing a user's reply from both HTML and plaintext. Please note |
| 940 | that some email clients extract the text from the HTML email they have received |
| 941 | and send this back as a quoted reply if you have set the client to plaintext |
| 942 | mode. In this case, Gerrit only supports parsing a change message. To work |
| 943 | around this issue, consider setting a <<email-format,User Preference>> to |
| 944 | receive only plaintext emails. |
| 945 | |
| 946 | Example notification: |
| 947 | ---- |
| 948 | Some User has posted comments on this change. |
| 949 | (https://gerrit-review.googlesource.com/123123 ) |
| 950 | |
| 951 | Change subject: My new change |
| 952 | ...................................................................... |
| 953 | |
| 954 | |
| 955 | Patch Set 3: |
| 956 | |
| 957 | Just a couple of smaller things I found. |
| 958 | |
| 959 | https://gerrit-review.googlesource.com/#/c/123123/3/MyFile.java |
| 960 | File |
| 961 | MyFile.java: |
| 962 | |
| 963 | https://gerrit-review.googlesource.com/#/c/123123/3/MyFile@420 |
| 964 | PS3, Line 420: someMethodCall(param); |
| 965 | Seems to be failing the tests. |
| 966 | |
| 967 | |
| 968 | -- |
| 969 | To view, visit https://gerrit-review.googlesource.com/123123 |
| 970 | To unsubscribe, visit https://gerrit-review.googlesource.com/settings |
| 971 | |
| 972 | (Footers omitted for brevity, must be included in all emails) |
| 973 | ---- |
| 974 | |
| 975 | Example response from the user: |
| 976 | ---- |
| 977 | Thanks, I'll fix it. |
| 978 | > Some User has posted comments on this change. |
| 979 | > (https://gerrit-review.googlesource.com/123123 ) |
| 980 | > |
| 981 | > Change subject: My new change |
| 982 | > ...................................................................... |
| 983 | > |
| 984 | > |
| 985 | > Patch Set 3: |
| 986 | > |
| 987 | > Just a couple of smaller things I found. |
| 988 | > |
| 989 | > https://gerrit-review.googlesource.com/#/c/123123/3/MyFile.java |
| 990 | > File |
| 991 | > MyFile.java: |
| 992 | Rename this file to File.java |
| 993 | > |
| 994 | > https://gerrit-review.googlesource.com/#/c/123123/3/MyFile@420 |
| 995 | > PS3, Line 420: someMethodCall(param); |
| 996 | > Seems to be failing the tests. |
| 997 | > |
| 998 | Yeah, I see why, let me try again. |
| 999 | > |
| 1000 | > -- |
| 1001 | > To view, visit https://gerrit-review.googlesource.com/123123 |
| 1002 | > To unsubscribe, visit https://gerrit-review.googlesource.com/settings |
| 1003 | > |
| 1004 | > (Footers omitted for brevity, must be included in all emails) |
| 1005 | ---- |
| 1006 | |
| 1007 | In this case, Gerrit will persist a change message ("Thanks, I'll fix it."), |
| 1008 | a file comment ("Rename this file to File.java") as well as a reply to an |
| 1009 | inline comment ("Yeah, I see why, let me try again."). |
| 1010 | |
Edwin Kempin | 0118c5d | 2019-09-27 11:01:26 +0200 | [diff] [blame] | 1011 | [[security-fixes]] |
Matthias Sohn | 4819d1e | 2023-01-09 11:54:56 +0100 | [diff] [blame] | 1012 | == Security Fixes |
Edwin Kempin | 0118c5d | 2019-09-27 11:01:26 +0200 | [diff] [blame] | 1013 | |
| 1014 | If a security vulnerability is discovered you normally want to have an |
| 1015 | embargo about it until fixed releases have been made available. This |
| 1016 | means you want to develop and review security fixes in private. |
| 1017 | |
| 1018 | If your repository is public or grants broad read access it is |
| 1019 | recommended to fix security issues in a copy of your repository which |
| 1020 | has very restricted read permissions (e.g. `myproject-security-fixes`). |
| 1021 | You can then implement, review and submit the security fix in this |
| 1022 | repository, make and publish a new release and only then integrate the |
| 1023 | security fix back into the normal (public) repository. |
| 1024 | |
| 1025 | Alternatively you can do the security fix in your normal repository in |
| 1026 | a branch with restricted read permissions. We don't recommend this |
| 1027 | because there is a risk of configuring the access rights wrongly and |
| 1028 | unintentionally granting read access to the wrong people. |
| 1029 | |
| 1030 | Using private changes for security fixes is *not* recommended due to |
| 1031 | the link:#private-changes-pitfalls[pitfalls] discussed above. |
| 1032 | Especially you don't want the fix to become visible after submit and |
| 1033 | before you had a chance to make and publish a new release. |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 1034 | |
| 1035 | GERRIT |
| 1036 | ------ |
| 1037 | Part of link:index.html[Gerrit Code Review] |
| 1038 | |
| 1039 | SEARCHBOX |
| 1040 | --------- |