Skip to content

differ: detect version upgrades/downgrades #206

@water-sucks

Description

@water-sucks

Feature Description

For each detected version in the internal differ, display an up or down arrow in the symbol column (the first one) for if the package was upgraded/downgraded, alongside the existing symbols. The rules for detecting this can be the same ones that Nix itself uses for nix-env -u, defined here: https://releases.nixos.org/nix/nix-2.16.3/manual/command-ref/nix-env/upgrade.html#versions.

The upgrade/downgrade detection is not always going to be 100% accurate, since versions can be super arbitrary depending on the derivation; just focus on if they match the defined rules or not and make sure test cases exist.

Since each derivation name can contain multiple versions associated with it, corresponding versions from before -> after should be approximately paired. dix, a similar diffing tool, does this using the Hungarian algorithm and Levenshtein distance; we could likely do something similar here. However, since the version lists tend to be super short, simpler alternatives to this would be preferred if possible.

Help

Yes

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions