Jump to content

Help:Edit conflict

From mediawiki.org
PD Note: When you edit this page, you agree to release your contribution under the CC0. See Public Domain Help Pages for more info. PD

Edit conflicts in MediaWiki happens when two or more users try to edit the same section of a page simultaneously.

If one user saves their changes, and another who was still editing attempts to save theirs, MediaWiki identifies a conflict because the underlying content has changed since the second user began editing. The system then requires the second user to manually resolve the conflict by merging their changes with the latest version of the page. This prevents unintentional overwrites and ensures that all contributions are considered.

If the system is slow when saving, you might make additional edits before the first one is processed, leading to an edit conflict with yourself. The conflict page may show an outdated version, and if you save from there, your previous edits could be lost. To avoid this, wait for the first save to complete before making more changes.

Understanding the edit conflict page layout

[edit]

When there's an edit conflict in MediaWiki, the page title is automatically changed to the below:

Edit conflict: Page Title

Where "Page Title" is the title of the page you are editing.

Then above the edit box, the below notification message is displayed.

Someone else has changed this page since you started editing it.

The upper text area contains the page text as it currently exists. Your changes are shown in the lower text area. You will have to merge your changes into the existing text. Only the text in the upper text area will be published when you press "$1".

The upper text area refers to the edit box of your current edit.

The lower text area refers to the difference between your current edit and the stored revision. This is displayed at the bottom of the edit conflict page. See the image sample below:

How to resolve an edit conflict

[edit]

Scenario 1: Small changes vs. large changes

[edit]

If User 1's changes are minor while User 2's changes are significant, User 1 should work from User 2's version:

  1. Re-merge user 1's changes - Manually re-apply User 1's small changes to User 2's version.
  2. Edit summary - Include "via edit conflict, will remerge" in the edit summary to indicate that an edit conflict was resolved.
  3. Notify via Talk Page - Use Template:Edit conflict on the Discussion/Talk page to inform User 2 and others about the conflict resolution, allowing User 2 to review the merged changes for accuracy.

Scenario 2: Large changes vs. small changes

[edit]

If User 1 made significant edits and User 2 made only minor adjustments:

  1. Work from user 1's version - Start with User 1's version of the text.
  2. Incorporate user 2's edits - Copy the relevant section(s) from User 2's version into User 1's. If User 1 was section editing, only copy the affected section.
  3. Edit summary - Use a summary like "via edit conflict, will remerge".
  4. Apply user 2's changes - After saving, review the page history, identify User 2's edits, and re-apply them in a subsequent edit.

Scenario 3: Both users make large changes

[edit]

When both users have made significant changes:

  1. Submit user 1's version - User 1 may submit their version first.
  2. Collaborate - Both users should review both versions and collaborate to merge their changes. This may involve discussion to determine the best approach.

General best practices

[edit]
  1. Avoid overwriting - Never simply overwrite another user's changes. Always assume good faith and use the conflict resolution tools effectively.
  2. Use the diff tool - After merging, double-check the changes by comparing versions with the diff feature to ensure nothing important is lost.
  3. Respect the process - Ignoring edit conflicts is not acceptable. Proper resolution ensures that all contributors' efforts are respected and integrated.

By following these guidelines, contributors can effectively manage edit conflicts and ensure that collaborative editing remains smooth and productive.

Handling logical edit conflicts

[edit]

Logical edit conflicts occur when multiple editors make changes to a page simultaneously, but the conflict isn't detected by MediaWiki's standard edit conflict system.

This typically happens when an editor copies the entire source text into a local text editor, makes extensive modifications, and then pastes the updated content back into the wiki.

If another editor has made changes during this time, those changes might be unintentionally overwritten.

To avoid logical edit conflicts, follow these best practices:

  • Edit in the original edit box - After copying the source text, ensure that you paste your updated content back into the same edit box from which it was originally copied. This reduces the risk of losing other editors' changes that might have occurred while you were editing.
  • Check for recent changes - Before pasting your modifications back onto the page, always check the page history for any edits made since you started. If there are changes, review and merge them into your content to avoid overwriting someone else's contributions.

By following these steps, editors can help maintain the integrity of collaborative editing on the wiki and minimize the risk of undetected edit conflicts.

Reverting to a previous version

[edit]

When you revert a page to an earlier version in MediaWiki, there's a risk of accidentally removing newer edits. This happens because the edit conflict detection system may not warn you about conflicts when reverting, so changes made after the version you're reverting to might be lost.

How to revert safely

[edit]
  • Copy and paste - Instead of directly reverting, copy the content from the older version and paste it into the latest version. This way, you can keep any recent changes.
  • Check differences (Diff) - After reverting, always check the difference (diff) between your version and the latest one to make sure you haven't removed any recent edits.
  • Avoid reversion wars - Reverting back and forth can lead to conflicts with other editors. It's better to discuss changes and reach an agreement.

Following these steps will help you avoid accidentally undoing someone else's work.

Preventing edit conflicts

[edit]

To minimize edit conflicts and streamline your editing process, focus on these core strategies:

  • Edit less frequently modified pages - Try to focus on pages that haven't been edited recently. This reduces the likelihood of encountering other users making edits simultaneously.
  • Make larger, consolidated edits - Combine your changes into a single, comprehensive edit rather than making multiple small changes. This reduces the likelihood of causing edit conflicts for others. Use the "Show preview" button to review your changes before saving.
  • Use an "In Use" notice - If you're making significant edits to a page, place a Template:Inuse at the top to signal to others that the page is being actively edited. Remove the template once your edits are complete.
  • Automatic edit conflict merging - MediaWiki's will automatically merge edits that touch unrelated parts of a page, and will only trigger an edit conflict if multiple users attempt to edit the same lines.

See also

[edit]