[Nix-dev] RFC: NixOS version string format

Bjørn Forsman bjorn.forsman at gmail.com
Thu May 1 15:15:50 CEST 2014


On 1 May 2014 14:47, Peter Simons <simons at cryp.to> wrote:
> Hi Bjørn,
>
>  > Now that I've switched to the NixOS 14.04 release I see nixos-version
>  > printing "14.04.42698.54a7d1d (Baboon)". It is impossible to tell if
>  > that is close to release date or hundreds of commits later...
>
> well, is the number of commits that have happened after the release date
> a particularly meaningful information? Suppose that number is "18". What
> does that tell you? Why is it important?

Hm, that was actually a bit difficult question to answer :-)

I think the reason I want this is the same reason we have version
numbers in the first place; because it's easier for humans (me!) to
use/remember. Knowing that it's 18 commits after 14.04 is easier to
relate to than that it's 42698 commits since the very beginning. Also,
the current scheme looks a lot like MAJOR.MINOR.PATCH, but it doesn't
act like it: PATCH is never reset to zero, unlike other projects I've
seen. So it feels a bit odd to me. (Personal opinion, I agree!)

We could of course have used a master branch and stable1/2/3 with no
tags/release numbers at all, and rely on git to find some meaning
behind commit id "version numbers". But I guess we all agree that
*that's* not a good idea!

Also, if we switch to a "git describe" like version number (*and* have
git annotated tags for releases), "git describe" in nixpkgs would be
much more meaningful.

Made up example from an alternative (near future?) nixos world:

$ nixos-version
14.04-18-gabcd1234
$ cd nixpkgs
$ git describe
14.04-20-gdefg5678   # Ah, my checkout is two commits ahead!


Compare with current situation:

$ nixos-version
14.04.42698.54a7d1d (Baboon)
$ cd nixpkgs
$ git describe
fatal: No annotated tags can describe
'e4690a7a79153ce3d8989fb442c1f0f5ef534b44'.
However, there were unannotated tags: try --tags.

Ok, so my checkout is at e4690a7a79153ce3d8989fb442c1f0f5ef534b44 and
nixos is at 54a7d1d. Fire up git to see where that is, and whether
it's a single commit difference or hundreds of commits...

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list