[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: version format for git snapshot





On Mon, Sep 14, 2015 at 8:51 AM, Colin Watson <cjwatson@debian.org> wrote:

On Mon, Sep 14, 2015 at 07:51:09AM +0200, Thomas Koch wrote:
> How would you format the upstream part of the packages version number? How
> about 0.4+24+git+a5e5f9e?

I wouldn't put the commit identifier in the package version at all.  It
isn't sortable, so clearly doesn't belong in a version string; it can be
documented in the changelog instead.  I'd put a date in the version.

The problem with date is searching in git log is difficult.

This is what I generally do: last release + "git" + ISO 8601 date and time + 10-char substring of the commit id. I. e:

0.5+git20150531T211420-cdd9d98f2c-1

It includes all the information:

  • Last release (0.5)
  • It's screaming "I'm a git snapshot!" ("git")
  • It's sortable thanks to the ISO 8601 date *and* time (20150531T211420)
  • Commit id, for easier search in git log, git describe, etc (cdd9d98f2c)
  • Debian packaging version (1)
  • It's consistent: it's always the same regex, with no room for optional fields
Using the time is required, otherwise if there are two snapshots in one day, they may get the wrong sorting order due to the git commit id.

Do you think it's ugly? Wait to see what it gets to when I upload packages to my Ubuntu PPA :-)

0.5+git20150531T211420-cdd9d98f2c-1~vivid~pgquiles1

IMHO it'd be great if we could standardize on something, not matter what it is.

--
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)

Reply to: