Page MenuHomePhabricator

Diff colours change between red/green and yellow/blue depending on what's viewed
Closed, InvalidPublicBUG REPORT

Description

List of steps to reproduce:

What happens?:
If the comparison isn't against base, the colour scheme changes.
Note that this isn't always the case. Some comparisons are red/green, others aren't.
In certain cases, all four colours are used. (includes/resourceloader/ResourceLoader.php in the example linked above)

What should have happened instead?:
The colour scheme should be consistent. I don't care which one it is (having a slight preference for red/green because the contrast is better) as long as it is consistent.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
Whatever version of Gerrit we're running (3.4.4, but was happening earlier).
Also occurs when using incognito/not-logged in, so it can't be my particular preferences.

Related: T232893: Gerrit red-green diff make the code hard to read (impossible for color-blind users)

Event Timeline

This is a feature of Gerrit. From what I remember yellow/blue is when you rebase a change sometimes the file was changed in another change. So that’s what these colours show.

Boldly closing per last comment.

To be fair after all those years using Gerrit it is probably the first time I encounter the yellow / blue diff. Looking at the DOM, the elements are marked with the CSS class dueToRebase which eventually leads me to:

Gerrit Issue 217: Patch history does not account for rebase which got filed back in 2009 :]

And https://gerrit-review.googlesource.com/c/gerrit/+/105834 which has a nice summary of the problem and the comment by Shawn Pearce at https://gerrit-review.googlesource.com/c/gerrit/+/33091/5//COMMIT_MSG is worth a read as well.


T232893: Gerrit red-green diff make the code hard to read (impossible for color-blind users) was to replace the red/green with blue/yellow (which would have made the above dueToRebase diffs not differentiable). In Gerrit 2.x one could select in their user preference a different color scheme and I think we provided a default that had blue/yellow. As part of upgrading to Gerrit 3.x that feature got lost and we now have whatever is the default in Gerrit.

The color schemes might use enhancement for color blind users, maybe as part of a user preference to set the colors in the UI (if at all possible), but that is something that should be worked on directly with upstream.