blob: 49821afdc966252afd4dc14073f87e3f6c7d45af [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
47Files can be removed from the change, or restored, by clicking the icon to the
David Ostrovsky8cca1a42015-04-16 06:47:53 +020048left of the file name. Reverting a file in the change is also supported and is
49achieved in two steps: remove file from the change and restore the file in the
50change.
David Pursehouse66212092015-01-07 15:47:40 +090051
52To switch from edit mode back to review mode, click the 'Done Editing' button.
53
54image::images/inline-edit-file-list-in-edit-mode.png[width=800, link="images/inline-edit-file-list-in-edit-mode.png"]
55
56[[open-full-screen-editor]]
57While in edit mode, clicking on a file name in the file list opens a full
58screen editor for that file.
59
60To save edits, click the 'Save' button or press `CTRL-S`. To return to the
61change screen, click the 'Close' button.
62
David Pursehouse17138202015-10-20 13:35:55 +090063Note that when editing the commit message, trailing blank lines will be stripped.
64
David Pursehouse66212092015-01-07 15:47:40 +090065image::images/inline-edit-full-screen-editor.png[width=800, link="images/inline-edit-full-screen-editor.png"]
66
67If there are unsaved edits when the 'Close' button is pressed, a dialog will
68pop up asking to confirm the edits.
69
70image::images/inline-edit-confirm-unsaved-edits.png[width=800, link="images/inline-edit-confirm-unsaved-edits.png"]
71
72To discard the unsaved edits and return to the change screen, click the 'OK'
73button. To continue editing, click 'Cancel'.
74
75[[switch-to-edit-mode-from-side-by-side]]
76
77While in review mode, it is possible to switch directly to edit mode and into an
78editor for a file under review by clicking on the edit icon in the patch set list
79on the side-by-side diff view.
80
81image::images/inline-edit-enter-edit-mode-from-diff.png[width=800, link="images/inline-edit-enter-edit-mode-from-diff.png"]
82
83[[reviewing-changes-made-in-change-edit]]
84== Reviewing Change Edits
85
86Change edits are reviewed in the same way as regular patch sets, using the
87side-by-side diff screen. Change edits are shown as 'edit' in the patch list
88on the diff screen:
89
90image::images/inline-edit-edit-in-diff-screen-patch-list.png[width=800, link="images/inline-edit-edit-in-diff-screen-patch-list.png"]
91
92and on the change screen:
93
94image::images/inline-edit-edit-in-patch-list.png[width=800, link="images/inline-edit-edit-in-patch-list.png"]
95
96Note that patch sets may exist that were created after the change edit was created.
97
98For example this sequence:
99
100`1 2 3 4 5 6 7 8 9 edit 10`
101
102means that the change edit was created on top of patch set number 9 and a regular
103patch set was uploaded later.
David Ostrovsky6842df92014-12-19 09:20:31 +0100104
David Ostrovsky66796092014-12-24 14:30:00 +0100105[[change-edit-actions]]
106== Change Edit Actions
107
108Change edits can be deleted, published and rebased, and a patch set that
109represents a change edit can be downloaded like a regular patch set.
110
111[[delete-change-edit]]
112
113There is a special ref for a change edit. When the change edit is deleted, this
114ref is deleted as well. To delete a change edit click on the "Delete Edit"
115button.
116
117[[publish-change-edit]]
118
119When a change edit is based on the current patch set, it can be published. By
120publishing a change edit it is promoted to a regular patch set. The special ref
121that represents the change edit is deleted on publish. To publish a change edit
122click on the "Publish Edit" button. This button is only shown when the change
123edit is based on the current patch set. Otherwise the change edit must first be
124rebased onto the current patch set.
125
126[[rebase-change-edit]]
127
128Only change edits that are based on the current patch set can be published. If
129in the meantime a new patch set was uploaded, the change edit must be rebased on
130top of the current patch set before it can be published. Rebasing a change
131edit is done by clicking on the "Rebase Edit" button. If the rebase results in
132conflicts, these conflicts cannot be resolved in the browser. In this case the
133change edit must be downloaded (see below) and the conflicts must be resolved in
134the local environment. The commit that contains the conflict resolution can then
135be uploaded by setting `edit` as option on the target ref:
136
137----
138 $ git push host HEAD:refs/for/master%edit
139----
140
141[[download-change-edit-patch]]
142
143Like regular patch sets, change edits can be downloaded by the download
144commands (e.g. provided by the `download-commands` plugin). To download a
145change edit, select the desired scheme from the "Download" dropdown and copy the
146command to your terminal. Note: only change edit owners and users that were
147granted the link:access-control.html#capability_accessDatabase[accessDatabase]
148global capability are able to access change edit refs.
149
David Ostrovskyd63920f2014-12-24 14:34:36 +0100150[[not-implemented-features]]
151== Not Implemented Features
152
153* [PENDING CHANGE]
154The inline editor uses settings decided from the user's diff preferences, but those
155preferences are only modifiable from the side-by-side diff screen. It should be possible
156to open the preferences also from within the editor.
157
158* Allow to rename files that are already contained in the change (from the file table).
159The same rename file dialog can be used with preselected and disabled original file
160name.
161
162* Changed files in change edit should be marked as changed in file table in edit mode.
163One option is to use dirty icon or "*" char in front of changed files, another option
164is to use different hyperlink color for changed files (red?), to avoid adding yet another
165column to the file table
166
167* Add navigation icons in header area of edit screen. When dozen files need to be changed
168in context of change edit, this is not the best workflow to open one file in edit screen,
169change it, save it, close edit screen and select next file from the file table to edit.
170"<-" | "->" icons in header of edit screen could be used to navigate to the next file to
171change from the file table. This would behave like the navigation icons in side by side
172with thefollowing logic on click:
173
174** "save-when-file-was-changed" or
175** "close-when-no-changes"
176
177* Allow to activate different key maps, supported by CM: Emacs, Sublime, Vim. Load key
178maps dynamically. Currently default mode is used.
179
180* Implement conflict resolution during rebase of change edit using inline edit
181feature by creating new edit on top of current patch set with auto merge content
182
183* Similarly, reuse inline edit feature for conflict resolution during rebase of regular
184patch sets
185
David Ostrovsky6842df92014-12-19 09:20:31 +0100186GERRIT
187------
188Part of link:index.html[Gerrit Code Review]
189
190SEARCHBOX
191---------