metacpan / metacpan-web

Web interface for MetaCPAN
http://metacpan.org
Other
418 stars 237 forks source link

"Diff full distribution" link leads to reversed diff #3174

Closed mauke closed 2 months ago

mauke commented 2 months ago

In the single-file diff view (for comparing the differences between versions of a single file), there is a "Diff full distribution" link in the left sidebar. But it leads to a reverse diff of the whole distribution, which is backwards compared to the single-file view. It should show a forward diff instead.

To Reproduce

  1. Go to https://metacpan.org/release/MAUKE/Sys-GetRandom-PP-0.04/view/lib/Sys/GetRandom/PP.pm.
  2. From the "Diff with version" dropdown in the left sidebar, select "0.03 (MAUKE on 2024-09-16)".
  3. Observe that it shows a "forward" diff (the version number changes from 0.03 to 0.04):
    -our $VERSION = '0.03';
    +our $VERSION = '0.04';
  4. Click the "Diff full distribution" link in the left sidebar.
  5. Observe that it shows a "reverse" diff (the version number in all files changes from 0.04 to 0.03, the changelog entry is shown as removed, etc):
    -our $VERSION = '0.04';
    +our $VERSION = '0.03';

Interestingly, if (in the single-file diff view) you first click on "Reverse diff", then "Diff full distribution", you end up with a regular (non-reversed) full-distribution diff view.

Expected behavior

The full distribution diff should go the same way as the single-file diff we came from, or generally default to a "forward" view. (People who need the other direction can always use the "Reverse diff" link.)