| David Ostrovsky | 6842df9 | 2014-12-19 09:20:31 +0100 | [diff] [blame] | 1 | = Inline Edit |
| 2 | |
| 3 | This page explains the workflow for creating and amending changes in the |
| 4 | browser. |
| 5 | |
| 6 | |
| 7 | [[create-change]] |
| David Pursehouse | 0a1da09 | 2015-01-30 15:08:17 +0900 | [diff] [blame] | 8 | == Creating a New Change |
| David Ostrovsky | 6842df9 | 2014-12-19 09:20:31 +0100 | [diff] [blame] | 9 | |
| 10 | A new change can be created directly in the browser, meaning it is not necessary |
| 11 | to clone the whole repository to make trivial changes. |
| 12 | |
| David Pursehouse | 0a1da09 | 2015-01-30 15:08:17 +0900 | [diff] [blame] | 13 | The new change is created as a draft change, unless |
| 14 | link:config-gerrit.html#change.allowDrafts[change.allowDrafts] is set to false, |
| 15 | in which case the change is created as a normal new change. |
| 16 | |
| 17 | There are two different ways to create a new change: |
| David Ostrovsky | 6842df9 | 2014-12-19 09:20:31 +0100 | [diff] [blame] | 18 | |
| 19 | By clicking on the 'Create Change' button in the project screen: |
| 20 | |
| 21 | [[create-change-from-project-info-screen]] |
| 22 | |
| 23 | image::images/inline-edit-create-change-project-screen.png[width=800, link="images/inline-edit-create-change-project-screen.png"] |
| 24 | |
| 25 | The user can select the branch on which the new change should be created: |
| 26 | |
| 27 | image::images/inline-edit-create-change-project-screen-dialog.png[width=800, link="images/inline-edit-create-change-project-screen-dialog.png"] |
| 28 | |
| David Pursehouse | 0a1da09 | 2015-01-30 15:08:17 +0900 | [diff] [blame] | 29 | By clicking the 'Follow-Up' button on the change screen, to create a new change |
| 30 | based on the selected change. |
| David Ostrovsky | 6842df9 | 2014-12-19 09:20:31 +0100 | [diff] [blame] | 31 | |
| 32 | [[create-change-from-change-screen]] |
| 33 | |
| 34 | image::images/inline-edit-create-follow-up-change.png[width=800, link="images/inline-edit-create-follow-up-change.png"] |
| 35 | |
| David Pursehouse | 6621209 | 2015-01-07 15:47:40 +0900 | [diff] [blame] | 36 | [[editing-change]] |
| 37 | == Editing Changes |
| 38 | |
| 39 | To switch to edit mode, press the 'Edit' button at the top of the file list: |
| 40 | |
| 41 | [[switch-to-edit-mode]] |
| 42 | image::images/inline-edit-enter-edit-mode-from-file-list.png[width=800, link="images/inline-edit-enter-edit-mode-from-file-list.png"] |
| 43 | |
| 44 | While in edit mode, it is possible to add new files to the change by clicking |
| 45 | the 'Add...' button at the top of the file list. |
| 46 | |
| David Ostrovsky | 2051486 | 2015-05-04 08:00:54 +0200 | [diff] [blame] | 47 | File changes can be reverted or files can be removed from the change or |
| 48 | deleted files can be restored, by clicking the icons to the left of the file |
| 49 | name. |
| David Pursehouse | 6621209 | 2015-01-07 15:47:40 +0900 | [diff] [blame] | 50 | |
| 51 | To switch from edit mode back to review mode, click the 'Done Editing' button. |
| 52 | |
| 53 | image::images/inline-edit-file-list-in-edit-mode.png[width=800, link="images/inline-edit-file-list-in-edit-mode.png"] |
| 54 | |
| 55 | [[open-full-screen-editor]] |
| 56 | While in edit mode, clicking on a file name in the file list opens a full |
| 57 | screen editor for that file. |
| 58 | |
| 59 | To save edits, click the 'Save' button or press `CTRL-S`. To return to the |
| 60 | change screen, click the 'Close' button. |
| 61 | |
| David Pursehouse | 1713820 | 2015-10-20 13:35:55 +0900 | [diff] [blame] | 62 | Note that when editing the commit message, trailing blank lines will be stripped. |
| 63 | |
| David Pursehouse | 6621209 | 2015-01-07 15:47:40 +0900 | [diff] [blame] | 64 | image::images/inline-edit-full-screen-editor.png[width=800, link="images/inline-edit-full-screen-editor.png"] |
| 65 | |
| 66 | If there are unsaved edits when the 'Close' button is pressed, a dialog will |
| 67 | pop up asking to confirm the edits. |
| 68 | |
| 69 | image::images/inline-edit-confirm-unsaved-edits.png[width=800, link="images/inline-edit-confirm-unsaved-edits.png"] |
| 70 | |
| 71 | To discard the unsaved edits and return to the change screen, click the 'OK' |
| 72 | button. To continue editing, click 'Cancel'. |
| 73 | |
| 74 | [[switch-to-edit-mode-from-side-by-side]] |
| 75 | |
| 76 | While in review mode, it is possible to switch directly to edit mode and into an |
| 77 | editor for a file under review by clicking on the edit icon in the patch set list |
| 78 | on the side-by-side diff view. |
| 79 | |
| 80 | image::images/inline-edit-enter-edit-mode-from-diff.png[width=800, link="images/inline-edit-enter-edit-mode-from-diff.png"] |
| 81 | |
| 82 | [[reviewing-changes-made-in-change-edit]] |
| 83 | == Reviewing Change Edits |
| 84 | |
| 85 | Change edits are reviewed in the same way as regular patch sets, using the |
| 86 | side-by-side diff screen. Change edits are shown as 'edit' in the patch list |
| 87 | on the diff screen: |
| 88 | |
| 89 | image::images/inline-edit-edit-in-diff-screen-patch-list.png[width=800, link="images/inline-edit-edit-in-diff-screen-patch-list.png"] |
| 90 | |
| 91 | and on the change screen: |
| 92 | |
| 93 | image::images/inline-edit-edit-in-patch-list.png[width=800, link="images/inline-edit-edit-in-patch-list.png"] |
| 94 | |
| 95 | Note that patch sets may exist that were created after the change edit was created. |
| 96 | |
| 97 | For example this sequence: |
| 98 | |
| 99 | `1 2 3 4 5 6 7 8 9 edit 10` |
| 100 | |
| 101 | means that the change edit was created on top of patch set number 9 and a regular |
| 102 | patch set was uploaded later. |
| David Ostrovsky | 6842df9 | 2014-12-19 09:20:31 +0100 | [diff] [blame] | 103 | |
| David Ostrovsky | 6679609 | 2014-12-24 14:30:00 +0100 | [diff] [blame] | 104 | [[change-edit-actions]] |
| 105 | == Change Edit Actions |
| 106 | |
| 107 | Change edits can be deleted, published and rebased, and a patch set that |
| 108 | represents a change edit can be downloaded like a regular patch set. |
| 109 | |
| 110 | [[delete-change-edit]] |
| 111 | |
| 112 | There is a special ref for a change edit. When the change edit is deleted, this |
| 113 | ref is deleted as well. To delete a change edit click on the "Delete Edit" |
| 114 | button. |
| 115 | |
| 116 | [[publish-change-edit]] |
| 117 | |
| 118 | When a change edit is based on the current patch set, it can be published. By |
| 119 | publishing a change edit it is promoted to a regular patch set. The special ref |
| 120 | that represents the change edit is deleted on publish. To publish a change edit |
| 121 | click on the "Publish Edit" button. This button is only shown when the change |
| 122 | edit is based on the current patch set. Otherwise the change edit must first be |
| 123 | rebased onto the current patch set. |
| 124 | |
| 125 | [[rebase-change-edit]] |
| 126 | |
| 127 | Only change edits that are based on the current patch set can be published. If |
| 128 | in the meantime a new patch set was uploaded, the change edit must be rebased on |
| 129 | top of the current patch set before it can be published. Rebasing a change |
| 130 | edit is done by clicking on the "Rebase Edit" button. If the rebase results in |
| 131 | conflicts, these conflicts cannot be resolved in the browser. In this case the |
| 132 | change edit must be downloaded (see below) and the conflicts must be resolved in |
| 133 | the local environment. The commit that contains the conflict resolution can then |
| 134 | be uploaded by setting `edit` as option on the target ref: |
| 135 | |
| 136 | ---- |
| 137 | $ git push host HEAD:refs/for/master%edit |
| 138 | ---- |
| 139 | |
| 140 | [[download-change-edit-patch]] |
| 141 | |
| 142 | Like regular patch sets, change edits can be downloaded by the download |
| 143 | commands (e.g. provided by the `download-commands` plugin). To download a |
| 144 | change edit, select the desired scheme from the "Download" dropdown and copy the |
| 145 | command to your terminal. Note: only change edit owners and users that were |
| 146 | granted the link:access-control.html#capability_accessDatabase[accessDatabase] |
| 147 | global capability are able to access change edit refs. |
| 148 | |
| David Ostrovsky | 9952870 | 2015-04-30 23:48:35 +0200 | [diff] [blame] | 149 | [[search-for-change-edits]] |
| 150 | |
| 151 | To search change edits from the UI the link:user-search.html#has[has:edit] |
| 152 | predicate can be used. |
| 153 | |
| David Ostrovsky | 35c3a7d | 2015-05-01 01:01:17 +0200 | [diff] [blame] | 154 | Alternatively change edits can be accessed through "My => Edits" dashboard. |
| 155 | |
| David Ostrovsky | d63920f | 2014-12-24 14:34:36 +0100 | [diff] [blame] | 156 | [[not-implemented-features]] |
| 157 | == Not Implemented Features |
| 158 | |
| David Ostrovsky | 0ca0182 | 2014-11-14 20:16:57 +0100 | [diff] [blame] | 159 | * Support default configuration options for inline editor that an |
| 160 | administrator has set in `refs/users/default:preferences.config` file. |
| 161 | |
| David Ostrovsky | d63920f | 2014-12-24 14:34:36 +0100 | [diff] [blame] | 162 | * Allow to rename files that are already contained in the change (from the file table). |
| 163 | The same rename file dialog can be used with preselected and disabled original file |
| 164 | name. |
| 165 | |
| 166 | * Changed files in change edit should be marked as changed in file table in edit mode. |
| 167 | One option is to use dirty icon or "*" char in front of changed files, another option |
| 168 | is to use different hyperlink color for changed files (red?), to avoid adding yet another |
| 169 | column to the file table |
| 170 | |
| 171 | * Add navigation icons in header area of edit screen. When dozen files need to be changed |
| 172 | in context of change edit, this is not the best workflow to open one file in edit screen, |
| 173 | change it, save it, close edit screen and select next file from the file table to edit. |
| 174 | "<-" | "->" icons in header of edit screen could be used to navigate to the next file to |
| 175 | change from the file table. This would behave like the navigation icons in side by side |
| David Pursehouse | a61ee50 | 2016-09-06 16:27:09 +0900 | [diff] [blame] | 176 | with the following logic on click: |
| David Ostrovsky | d63920f | 2014-12-24 14:34:36 +0100 | [diff] [blame] | 177 | |
| 178 | ** "save-when-file-was-changed" or |
| 179 | ** "close-when-no-changes" |
| 180 | |
| David Ostrovsky | d63920f | 2014-12-24 14:34:36 +0100 | [diff] [blame] | 181 | * Implement conflict resolution during rebase of change edit using inline edit |
| 182 | feature by creating new edit on top of current patch set with auto merge content |
| 183 | |
| 184 | * Similarly, reuse inline edit feature for conflict resolution during rebase of regular |
| 185 | patch sets |
| 186 | |
| David Ostrovsky | 6842df9 | 2014-12-19 09:20:31 +0100 | [diff] [blame] | 187 | GERRIT |
| 188 | ------ |
| 189 | Part of link:index.html[Gerrit Code Review] |
| 190 | |
| 191 | SEARCHBOX |
| 192 | --------- |