Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source updates should record the change date #111

Open
bb010g opened this issue Jul 30, 2019 · 4 comments
Open

Source updates should record the change date #111

bb010g opened this issue Jul 30, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@bb010g
Copy link
Contributor

bb010g commented Jul 30, 2019

The convention for unstable packages is to use the last modification date as version. Niv should assist in setting this by recording it when updating in a property like date.

For VCS sources, this should be the date of the latest change (e.g. Git's commit date). For file sources, this can default to the current date. Datestamps should be normalized to UTC.

@nmattia
Copy link
Owner

nmattia commented Jul 30, 2019

Nice! Currently niv uses tarball releases from github, I’m not sure how we could grab the last commit date from there. It should probably just use nix-prefetch-git instead, which would also work around #62 though would hit performance quite heavily for big repos.

@bb010g
Copy link
Contributor Author

bb010g commented Aug 14, 2019

It's not a drop-in solution for Niv, but here's a script I've hacked together to emulate this with GitHub's v4 API: update-commit-dates.sh, commit-dates-query.jq, commit-dates-filter.jq

It runs pleasantly quickly. (This'll silently break if your Niv sources have underscores in them, but an actual solution could just index and avoid some extra bookeeeping by not being constructed out of curl and two separate jq invocations.)

@nmattia nmattia added the enhancement New feature or request label Jan 7, 2020
@Nadrieril
Copy link

Storing the current date would already be very useful. Maybe that's simpler as a first step ?

@Nadrieril
Copy link

Nadrieril commented Oct 28, 2020

I mean just storing the date of the last time an entry got niv updated would be already really helpful. Getting a more precise date from nix-prefetch-git could be done later on.
I wanted to try making a PR but I honestly can't follow the update code :(.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants