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

Command line attribute rev is ignored #36

Closed
nlewo opened this issue Mar 24, 2019 · 4 comments · Fixed by #68
Closed

Command line attribute rev is ignored #36

nlewo opened this issue Mar 24, 2019 · 4 comments · Fixed by #68

Comments

@nlewo
Copy link
Collaborator

nlewo commented Mar 24, 2019

The rev attribute is ignored when provided on CLI.

Considering niv add NixOS/nixpkgs -a rev=plop, the sources.json should contains rev=plop while rev have been updated according to the --branch attribute.

Specifying a rev attribute is useful when switching a project to Niv because it allows to introduce Niv without changing what is actually built.

@nmattia
Copy link
Owner

nmattia commented Mar 24, 2019

Indeed, this should be whenNotSet :

niv/Main.hs

Line 239 in c2698b0

setPackageSpecAttr "rev" (Aeson.String rev)

Nice catch! Will patch soon.

@michaelpj
Copy link
Contributor

It's a little more awkward than that. This is the bit that actually makes niv update do an update! I think that:

  • completePackageSpec should not update the rev (i.e. should use whenNotSet
  • We should have some other updatePackageSpec function that we use instead of completePackageSpec in cmdUpdate

@michaelpj
Copy link
Contributor

It would also be nice if niv update -a rev=<blob> would update to that revision, whereas currently it just updates to the latest regardless.

@nmattia
Copy link
Owner

nmattia commented Jun 3, 2019

This issue actually led me down a terribly deep rabbit hole: https://github.com/nmattia/niv/compare/nm-refactor (which is also aimed at making #35 nicer and hence blocking it). Hoping to find some time to finish things up soon... Worst case, Zurihac.

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

Successfully merging a pull request may close this issue.

3 participants