niv
niv copied to clipboard
Add example for fetching a particular version
$ niv add foo/bar -a rev=v10.0
If we add a specific revision, is the default that this version will remain non-updated upon call to niv update?
wondering if its worth adding a new flag just for revision (e.g. niv add foo/bar -rev v10.0)
@rencire definitely, see https://github.com/nmattia/niv/pull/138 by @michaelpj .
I realized it's very uncommon for people to use -r foo to change/set the repo, so maybe we could recycle this one for the rev.
If we add a specific revision, is the default that this version will remain non-updated upon call to niv update?
If you set the rev then it won't be updated during that update call. But it will get updated in subsequent calls. I think @knl and @zimbatm were looking for a point to point to a particular version as well: https://github.com/nmattia/niv/issues/141
Does this actually work? I tried to update my nixpkgs pin with
niv update nixpkgs -a rev=abcde
and the change was not reflected in the sources.json file.
You probably want to use niv modify: niv update updates the revision from the specified branch, which will overwrite what you set!
(This is a bit confusing, I think it's easy to confuse "update based on user input" vs "update based on remote source"!)
My version of niv doesn't seem to have a modify command.. perhaps it is extremely old. Time to upgrade.
niv update nixpkgs -a rev=abcde
regardless of your version, this should update the rev... can you share the nixpkgs entry?
I don't think it will, this is one of the reasons I asked for modify in the first place!
What happens is:
revgets set to what you asked for.updategoes and fetches the latest rev from the branch in the spec, and overwrites whatever you supplied in the first step.
No, specifying attributes should lock that particular attribute in the update. If the attribute gets updated, it's definitely a bug!