Nixpkgs: Clarify usage of -git suffix

Created on 10 Apr 2016  路  4Comments  路  Source: NixOS/nixpkgs

In our manual we have a guideline to add a -git suffix to the name. This contradicts my usual experience and also can be (rightfully) interpreted very broadly, e.g. in https://github.com/NixOS/nixpkgs/pull/14571. My views on this are:

  1. We don't usually use this suffix -- grep shows 42 usages of this, and from my own (not backed by numbers because it's difficult to construct good regexp for this) experience non-suffixed packages occur much more often.
  2. Why only -git? We should suffix all version control systems like this if we decide to uphold this practice.
  3. From my point of view it's an upstream implementation detail -- if we have a date instead of version it indicates that it's some code snapshot already.

We should also clarify if we want only package name to be suffixed, or attribute name and package directory should be suffixed too (as seen in https://github.com/NixOS/nixpkgs/pull/14571).

(Usage counted by grep -r -- '-git-2' and grep -r -- '-git-\$')

policy discussion

Most helpful comment

I dislike the git prefix, I agree that it should be reserved only for cases where a snapshot/nightly version is supplied alongside a preferred/released version, if it is to be used at all. In cases where a vcs snapshot is used out of necessity, that should not leak into the name/attr. As a user, why would I ever care about that? I may care about dates or even revisions but never the type of vcs backing it (or indeed that the code comes from a checkout & not, say, a tarball off someone's floppy disk).

All 4 comments

That was my idea to separate pkgs with versions and "nightly" pkgs. Like AUR does. But nowadays I think it's not so necessary.

One thing that makes this potentially useful is nix-env picking the latest available version by default. However, picking derivations by their names gives us enough problems and possibly would be a thing of the past. If we want to account for this case however, maybe we want to have this suffix only when both "snapshot" packages and regular ones are available, _and_ regular version is preferred (which is mostly the case)? Then it would prevent nix-env from picking nightly version.

Also, of course when we have both versions we want to name their _attributes_ differently (hello vs hello-git).

I dislike the git prefix, I agree that it should be reserved only for cases where a snapshot/nightly version is supplied alongside a preferred/released version, if it is to be used at all. In cases where a vcs snapshot is used out of necessity, that should not leak into the name/attr. As a user, why would I ever care about that? I may care about dates or even revisions but never the type of vcs backing it (or indeed that the code comes from a checkout & not, say, a tarball off someone's floppy disk).

Closed with 25980ed01e505ff20d8678b3dc21682fdff79b52, we now use the -unstable suffix instead of a -git or -svn.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sid-kap picture sid-kap  路  3Comments

teto picture teto  路  3Comments

ayyess picture ayyess  路  3Comments

spacekitteh picture spacekitteh  路  3Comments

lverns picture lverns  路  3Comments