Inline diff shows additions and removals interleaved with each other

Summary

Inline diffs in MRs are currently less readable, since in contiguous blocks which have changes, the additions and removals are all interleaved.

Steps to reproduce

  1. Ensure the unified_diff_lines feature flag is enabled
  2. Create an MR with a diff which changes multiple consecutive lines in a file
  3. View the MR in inline mode
  4. See interleaved additions/removals

Example Project

!41995 (diffs) (see in particular the ee/spec/frontend/security_configuration/sast/components/configuration_form_spec.js file diff)

What is the current bug behavior?

Additions/removals are interleaved.

What is the expected correct behavior?

One contiguous removal block, followed by one contiguous addition block (i.e., how git natively renders diffs)

Relevant logs and/or screenshots

Screenshot_from_2020-09-11_17-55-30

Output of checks

This bug happens on GitLab.com - at least, it did, until the unified_diff_lines feature flag was disabled.

Edited Sep 11, 2020 by Mark Florian
Assignee Loading
Time tracking Loading