Skip to content

Automatically stage all changes in the Web IDE

The Issue has been identified in the discussion related to committing deleted and changed entires at the same time.

The current behavior:

  1. If there are no files staged, clicking "Commit" stages all unstaged files automatically
  2. If there is at least one file staged ("Staged Changes" field) then this is what gets into the commit and hence to the MR. Those changed files that were not explicitly staged are simply ignored. This is, technically, by design.

To reproduce:

  1. Open web IDE on a project
  2. Delete a file
  3. Modify a file
  4. Go to the "Commit" view. Note deleted file being staged, while the changed one is still in "Unstaged changes"
  5. Select "Create new Merge Request" and "Create a new branch" options
  6. Click the "Commit" button without staging the changed file.
  7. In the new MR form, note that the changed file has not been picked up in "Changes" tab for the MR (at the bottom of the form)

This might look counter-intuitive for the end-users even though it follows the original path of git.

Video from #31704 (comment 226025679)

Issue Video

Proposal

In order to make the workflow easier to understand, we are going to automatically stage all changes.

In addition to that, the following changes have to be made:

On the Edit tab, change the sentence x unstaged and x staged changes to x staged and x unstaged changes. It could otherwise be confusing if the user makes a change and the first number they read is 0.

image

In addition to that, as soon as the user presses the button "Commit" in either the Edit or Review tab, they will switch to the commit tab with the commit message, branch selection and merge request checkbox expanded. So far the user first arrived at this screen where they had to click on "Commit" again.

image

Instead, we want to lead the user directly to this state:

image

Edited by Kai Armstrong