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