Page MenuHomePhabricator

[[Special:Diff]] - counterintuitive order of oldid/newid parameters
Open, LowestPublicFeature

Description

This is not exactly a bug a this time but I wasn't quite sure where to report it otherwise:

The new special page [[Special:Diff]] allows to easily link to diff pages, e.g.
[[Special:Diff/newid]] will link to the difference introduced "newid"

When one wants the diff between multiple versions one has however to write
[[Special:Diff/oldid/newid]] to get the difference between "oldid" and "newid"

Therefore the order of parameter changes: "newid" is now the second instead of the first parameter. "oldid" takes it's place.

  • Isn't this highly counterintuitive?
  • Wouldn't be [[Special:Diff/newid/oldid]] bemuch more natural?

Also in a normal workflow one would propaply 1) start with creating a difflink with respect to the resulting version and only *afterwards* one would add the old version (which the resulting version should be compared to) if necessary. In most cases an old version isn't necessary though and "newid" will almost always be the first parameter (with only those few exceptions where an "oldid" is actually needed).

I therefore want to ask, if anybody feels differently and would propose to change the ordering otherwise as long as [[SPecial:Diff]] isn't much used yet.


Version: 1.23.0
Severity: enhancement

Details

Reference
bz63442

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 3:08 AM
bzimport set Reference to bz63442.
bzimport added a subscriber: Unknown Object (MLST).

Any idea how long it's been like this? Wondering if breaking is really worth it...

This has been merged on January 26th, see
https://gerrit.wikimedia.org/r/#/c/63395/

I think usage (with two parameters) is still very low so we wouln't break much if we make the change now.

If you look at the linked commit, the actual behaviour is even contrary to the one implied by the commit message (which uses "12345" as the "diff" ID in the first four examples therfore suggesting "98765" would be the "oldid" in the last example). So it could even be considered a bug and for not working "as designed".

CC'ing authors of the commit so they can add their judgment.

This is the expected behavior (you're right that the commit message is not clear on this) and personally I think this order is more "natural" (even if inconsistent with the single-parameter version), but I'm not particularly attached to it.

Hi everyone,

This is just my opinion, but I don't think the current behavior is less intuitive than the suggested one — rather the opposite, actually:

  • the left parameter is what will be shown on the left side of your screen and the right parameter on the right side (remember that it's possible to diff revisions in whatever order you want; it'll just display the diff leftside right);
  • this syntax is consistent with Diff/<oldid>/next and Diff/<oldid>/cur (arguably, it's not with Diff/<newid>/prev, though);
  • this is similar to the syntax of popular VCS, such as subversion (svn diff -c newid vs svn diff -r oldid:newid) and git (git show newid vs git diff oldid:newid).

If anything is to be changed, for me it would be to make “prev”, “next” and “cur” usable both as first and second parameters (with the result of Diff/<newid>/prev syntax meaning the opposite of what it means today, ie. newid shown on the left and prev shown on the right).

Best regards,

(In reply to Jérémie Roquet from comment #5)

If anything is to be changed, for me it would be to make “prev”, “next” and
“cur” usable both as first and second parameters (with the result of
Diff/<newid>/prev syntax meaning the opposite of what it means today, ie.
newid shown on the left and prev shown on the right).

Actually (from my side) this would be fine, too. For me the crucial point is consistency. That is meaning (or order) of the parameters shouldn't change regardless of what kind of parameters you pass (an ID or prev/cur/next).

Therefore it basically breaks down to these two options:

  1. [[Special:Diff/right_version/left_version]]
  2. [[Special:Diff/left_version/right_version]]

If only one parameter is specified both cases above would get

[[Special:Diff/right_version]]
  1. is what I initially proposed. It's advantage is that also if only one parameter is specified, it still is the version on the right in the current implementation. Therefore the meaning of the first parameter *never* changes.
  1. is slightly more intuitive in that it normally orders versions chronologically (since normally the older version will be shown on the left and the newer version will be shown on the right).

However if only one parameter is specified, this will be the version that is shown on the right therefore switching the meaning of first/second parameter.

All in all I could live with both options, but changing behavior based on whether an ID is given or a relation like prev/cur/next is inconsistent and seems wrong to me.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:14 AM
Aklapper removed a subscriber: wikibugs-l-list.