Bumping version numbers for new releases in associated files (documentation)

前端 未结 3 2040
醉梦人生
醉梦人生 2020-12-31 14:20

I would be interested to in knowing how you out there handle the bumping the version number for new releases issue.

How do you handle the version number in

相关标签:
3条回答
  • 2020-12-31 15:06

    We use the classic major.minor.patch system, which gets applied to release candidates as a 'tag', we have a script which tags a commit as the version number, rather than use a git 'tag object'. All the version numbering is done 'by hand'. It works reasonably well, because the version number is created by the 'release onto staging' scripts, which is much later on in the development process. We don't bother using any of the git hooks, because we don't really need to, if a commit isn't leaving the development environment then it doesn't need id other than it's internal SHA code.

    We try to enforce that every 'patch' release must be binary compatible with other versions with the same major,minor tag.

    That way, anything with a tag should at least build, but it's possible or quite likely that it won't work to spec.

    A refinement would be to get the QA department to create a signed tag object on anything that is 'QA approved' but for now we rely on other paperwork for that.

    0 讨论(0)
  • 2020-12-31 15:19

    I think that the standard way to do this is to use Git's hook system and m4 or sed/awk to do the search/replace as you suggest. You just need a special token with in a comment in each file (probably in the header).

    Here's the reference on githooks and here's a few pages written by people solving the same problem:

    • http://groups.google.com/group/memcached/browse_thread/thread/b02e992ede0f0e89
    • http://blog.rfwatson.net/2009/06/03/automatic-version-numbering-using-git/

    Both of these rely on storing the version number in a file somewhere in your source tree.

    I also came across a took called 0release that claims to automate release creation (and setting version numbers).

    Finally, regarding release numbers, this is addressed in several other questions:

    • What version numbering scheme do you recommend?
    • How do you do version numbering in an agile project?
    • What version number scheme for poorly planned, branched, and schizophrenic application
    • And more https://stackoverflow.com/search?q=release+numbering
    0 讨论(0)
  • 2020-12-31 15:22

    A common solution nowadays is to invoke AC_INIT with an m4_esyscmd argument to generate the VERSION from git. For example, autoconf's configure.ac contains the lines:

    AC_INIT([GNU Autoconf],
            m4_esyscmd([build-aux/git-version-gen .tarball-version]),
            [bug-autoconf@gnu.org])
    

    where build-aux/git-version-gen is a simple script that calls 'git describe' to generate the version number. (see gnulib)

    There are drawbacks to this approach, but it can be effective.

    0 讨论(0)
提交回复
热议问题