Missing merge (conflict) warning message in web editor for git repositories
Summary
When editing the a file in a repository through the web editor in two (or more) editor windows simultaneously, and then successively saving the edits and without updating or git pull
-ing, only the last save is persisted without giving a warning about, or a solution to, merges. I would expect at least a warning with a diff output.
The same result can be obtained by editing a file from a repository simultaneously in the web editor and in a checked out version of the repository. In this scenario, the problem arises only when it is the web editor that saves the last, as the git binary handles merge conflicts just fine.
Steps to reproduce
- Open an edit wiki page window in e.g. the wiki repository
- Check out the wiki as a git repository
- Open the same page in an editor from the checked out repository
- Write some text in the edit window in the web frontend
- Write some text in the editor from the checked out repository
- Commit and push the repository changes
- Save the edit from the web frontend
- Notice that only the changes from the web frontend edit session is in the latest commit; the changes from the checked out repository are silently overwritten
Expected behavior
A warning window telling me that a merge is about to happen and whether I would like to: 2. abort the process, losing the changes I made 2. use the changes I made, overwriting the remote changes 2. merge the two changes, possibly via another edit session resolving any conflicts
Relevant logs and/or screenshots
N/A
Output of checks
Results of GitLab Application Check
I am doing this as an end-user without access to the command-line of the server where the gitlab installation is running. I am unable to perform the GitLab Application Checks
Possible fixes
I suspect that the following file need some changes to the logic:
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/services/wiki_pages/update_service.rb#L2