Re: [Nix-dev] RFC: NixOS version string format

2014-05-01 Thread Bjørn Forsman
On 1 May 2014 14:47, Peter Simons sim...@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
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] RFC: NixOS version string format

2014-05-01 Thread Eelco Dolstra
Hi,

On 01/05/14 15:15, Bjørn Forsman wrote:

 
 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!)

I agree that having the number of commits since the start of the branch is
nicer. I've just made a change that does this. The only problem is that it
causes the version number in the 14.04 branch to jump backwards this once, but
since we're not using it for anything automated, it shouldn't be a big problem.

 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!

That's assuming you're on the 14.04 branch. If you're on master, and 14.04 is
the nearest tag, it will say something similar, but it will be misleading
because they're not the same commits.

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] RFC: NixOS version string format

2014-05-01 Thread Bjørn Forsman
On 1 May 2014 16:58, Bjørn Forsman bjorn.fors...@gmail.com wrote:
 On 1 May 2014 16:19, Kirill Elagin kirela...@gmail.com wrote:
 On Thu, May 1, 2014 at 5:43 PM, Bjørn Forsman bjorn.fors...@gmail.com
 wrote:

 To complicate further, if the release tag is made on the release
 branch and is not reachable from master, I don't think git describe
 on master will find that tag at all.

 Sure, but there are normally no commits in the release branch (before actual
 release)
 that are not in master, so it should be safe to merge the branches. We can
 just require this merge
 right after creating the release [annotated] tag during the release
 procedure.

 Yes, it should be safe.

 1. git tag -a -m Release 14.04 v14.04 release-14.04~N
 # Adjust N to match nixos-version output on stable channel,
 https://github.com/NixOS/nixpkgs/commit/21e8cfac80c6c0ccac87ec8947d895fae485b7da

 2. git checkout master

 3. git merge release-14.04

To be precise, it should be git merge v14.04. That is, merge the
tag, not the branch. The branch may have additional commits after the
tag that we do not want.

Best regards,
Bjørn Forsman
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] RFC: NixOS version string format

2014-04-27 Thread Bjørn Forsman
Hi all,

For a long time I've felt that the NixOS version string format

VERSION pre NUM_COMMITS_SINCE_THE_VERY_BEGINNING

is a bit odd. It feels like a MAJOR.MINOR.PATH format, but PATCH is
every increasing. I personally would prefer the number of commits
number to be start over each time the version number is bumped. IMHO,
that would make it easier to reason about which version you're on.

I think such a version number format would also match nicely with what
git describe would print if/when we have proper annotated git tags
for releases (we should!).

Thoughts?

Best regards,
Bjørn Forsman
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] RFC: NixOS version string format

2014-04-27 Thread Marc Weber
We're using git, thus the only really meaningfull thing is the hash ..
But its hard to compare which is more or less up to date.

Thus maybe its worth thiking about adding the hash if it is not
included.

The hash also identifies the history.

Marc Weber
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] RFC: NixOS version string format

2014-04-27 Thread Luca Bruno
The hash is already included in nixos-version.


On Sun, Apr 27, 2014 at 12:43 PM, Marc Weber marco-owe...@gmx.de wrote:

 We're using git, thus the only really meaningfull thing is the hash ..
 But its hard to compare which is more or less up to date.

 Thus maybe its worth thiking about adding the hash if it is not
 included.

 The hash also identifies the history.

 Marc Weber
 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev




-- 
www.debian.org - The Universal Operating System
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] RFC: NixOS version string format

2014-04-27 Thread Kirill Elagin
+1 for annotated tags and `git describe`.
It will also include a hash. Plus some additional useful information.
This way we automagically get beautiful names for releases and useful names
(with last tag and commit hash) for intermediate versions.

Upcoming 14.04 release might be a good point to start creating annotated
tags, right?


--
Кирилл Елагин


On Sun, Apr 27, 2014 at 2:52 PM, Luca Bruno lethalma...@gmail.com wrote:

 The hash is already included in nixos-version.


 On Sun, Apr 27, 2014 at 12:43 PM, Marc Weber marco-owe...@gmx.de wrote:

 We're using git, thus the only really meaningfull thing is the hash ..
 But its hard to compare which is more or less up to date.

 Thus maybe its worth thiking about adding the hash if it is not
 included.

 The hash also identifies the history.

 Marc Weber
 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev




 --
 www.debian.org - The Universal Operating System

 ___
 nix-dev mailing list
 nix-dev@lists.science.uu.nl
 http://lists.science.uu.nl/mailman/listinfo/nix-dev


___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] RFC: NixOS version string format

2014-04-27 Thread Vladimír Čunát

On 04/27/2014 12:00 PM, Bjørn Forsman wrote:

For a long time I've felt that the NixOS version string format

VERSION pre NUM_COMMITS_SINCE_THE_VERY_BEGINNING


Perhaps I don't understand what you mean. nixos-version for me prints
14.04pre- + git-hash

BTW, the number of commits since 14.04 does give a better intuition than 
hash by itself, but IMO the actual commit date seems even better

(and it's supposed to be monotonous, too).

Vlada




smime.p7s
Description: S/MIME Cryptographic Signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] RFC: NixOS version string format

2014-04-27 Thread Bjørn Forsman
On 27 April 2014 16:54, Vladimír Čunát vcu...@gmail.com wrote:
 On 04/27/2014 12:00 PM, Bjørn Forsman wrote:

 For a long time I've felt that the NixOS version string format

 VERSION pre NUM_COMMITS_SINCE_THE_VERY_BEGINNING

 Perhaps I don't understand what you mean. nixos-version for me prints
 14.04pre- + git-hash

Yes, sorry, I didn't mention the hash for some reason. I guess I
thought it was a good idea to leave it out of the discussion because
it's not something I want to change. Like Marc Weber says above, when
using git/distributed system, the hash is the only true identifier. I
agree with that.

To clear things up:
* nixos-version currently adds the git-hash at the very end and I
don't want to change that
* git describe also adds a hash at the end to provide unique
identifier (iff the commit isn't exactly on a tag)

Best regards,
Bjørn Forsman
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev