nmattia / niv

Easy dependency management for Nix projects
https://github.com/nmattia/niv
MIT License
1.61k stars 79 forks source link

`rev` vs `version` #232

Closed sir4ur0n closed 3 years ago

sir4ur0n commented 4 years ago

Hello!

Using this option doesn't touch the rev field but instead adds a version field, which seems unused by Niv?

It looks like the field was renamed from rev to version or vice-versa but not everything was migrated, is my intuition right?

If yes: I propose we use this issue to fix this inconsistency. If no: then what's the deal with these 2 options? It should be documented/further explained, as it's ambiguous. And why isn't there an option in niv update and niv modify to change the rev field, as it seems to be the default?

I'm not used to Niv (yet) so please bear with me if my understandings are wrong :grin:

nmattia commented 4 years ago

Interesting, I never thought this would create confusion. They are indeed unrelated; the version is used when fetching file by URL (template). I think I'll just add a --rev flag for setting the revision; I might even remove -r (which is --repo) because it's pretty rare that people update the repo.

nmattia commented 4 years ago

@Sir4ur0n does this help? https://github.com/nmattia/niv/pull/271

sir4ur0n commented 4 years ago

@nmattia yes, it does (thank you by the way!), though I think the role of attributes should be clarified, at least on the readme, what do you think? The relationship between attributes and templates is never explained explicitly...