Add the ability to show package history#152
Open
anvacaru wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
--historyflag tokup listthat shows the versions you have previously had installed for each package, reconstructed from the Nix profile generations.kup list --history— print the version timeline for every package that appears in the generation history.kup list <package> --history— print the timeline for a single package.Each row shows the generation number, the date, and the version (git tag if known, otherwise the short commit;
local checkout (<path>)forgit+file://builds). The version installed in the active generation is highlighted and marked with→. Consecutive generations with the same package version are collapsed, so the table shows version changes rather than every generation bump.How it works
Every
kup install/update/uninstallcreates a new Nix profile generation, stored as aprofile-<N>-linksymlink whose target contains amanifest.json(the same formatreload_packagesalready parses). The history is built by reading those manifests in order:Changes
src/kup/package.py:InstalledVersiondataclass,read_generation_manifests,GENERATION_LINK_RE.src/kup/__main__.py:profile_generations_dir,build_history,_mark_current,_enrich_tags,_format_version,list_history;--historyargument on thelistsubparser and its dispatch. The duplicated GitHub auth block in the existing version listing is factored into_github_auth.src/kup/list-help.md,README.md: document the flag with an example.src/tests/unit/test_unit.py: unit tests for generation parsing (including garbage-collected generations andurinormalization), the collapsing and current-version marking inbuild_history, local-checkout entries, package filtering, version formatting, and profile symlink resolution. The tests run offline.